Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp198484iob; Wed, 27 Apr 2022 23:47:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJznO/0tPMWGJnrPwu9+afQ/xdHxOlm2cb1PyQ8bdEjnAjJUsz/zCCyeskwoecpZD+4yv4vI X-Received: by 2002:a17:902:cec5:b0:15d:1e53:6f1a with SMTP id d5-20020a170902cec500b0015d1e536f1amr17637018plg.2.1651128476601; Wed, 27 Apr 2022 23:47:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651128476; cv=none; d=google.com; s=arc-20160816; b=iglJkUfQr/TujUuCNwB4tID4AU0Oh2R1kVGamdCcoSzlZ/UZ8Us5OoYC64NPTYHukt UqSrIeOmyPtba6oY1VCGJ5Qkv59LpaFsIHsWaj4pFG5OOFIzzv9kqWneOdJ+Lau84UB7 UTpEOvqAaTvP+WsRxrnPVCWesv/bCMjO0tqdGdJI0oIcqBCsCUE22O7WeyUVNvDAcKY0 3P7Ynb9pYiC0qP1XbAVjzzU4wNCMm0R6xOSIkW/UKKjgC0e3bd5rU8d48yel8Uglz3Xm EkQ/a00ntjaX0cMdIfnx6TRKqv0ON7EUdN3IJT5u8SB35cV7dZh7kFeWbhBMTI7Pjuy3 k7Ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=ZtQqXodwAxDOFyBsncQ3VIj2vv1xD7e9kF/rrL5I4pE=; b=WEkjkIn5rL0HUJoabfN8o0ETb53y0us1LkT7WoCOFlQ4bRYUhvV2bgx3Y3ABzCcX4u ZDxa8iyGm8I3UxTw9rE7HXn02uFnIIunNmPsK9Rsy3VZxJscEczuC106ch6AfAS2VKHj eCMi1D6lVG3IT3Gmh4ks9dqpJq29K9GTgOeP2SOQvA7/0m6FrQ50dRd5XXXQGeWFeEQj BHiWqjwNIwdhPW2kxa6g9nT4Nz/dXQr+GKKiK/RHSh2y9wVyLIiyIKPEUTVrb1ajFW9H I+4L7ad6VMYjttCQwrRwDL/0eEn9Uxaw9k7wZ3a6w4ezNeQQIb5AU1EoJpQqp3rJjDkO 0Ltg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RIGsrZGE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 1-20020a17090a0f0100b001d2acdc720bsi4369174pjy.6.2022.04.27.23.47.42; Wed, 27 Apr 2022 23:47:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RIGsrZGE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230431AbiD1AAK (ORCPT + 99 others); Wed, 27 Apr 2022 20:00:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229492AbiD1AAJ (ORCPT ); Wed, 27 Apr 2022 20:00:09 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6F5295C665 for ; Wed, 27 Apr 2022 16:56:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651103815; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZtQqXodwAxDOFyBsncQ3VIj2vv1xD7e9kF/rrL5I4pE=; b=RIGsrZGEP3B21vLpR5jdEiyv7x62tbM3vx0yldWgMsits5LFQ9Yu3P9JaJwgsxnkYKT378 IH6Ax0Ji708XPOsZKnZrG1IWlzadAaThimCc+scjhKQyZC39AELMnIDOxwrWkeHSpRlsgL s8PiWFmtMRG15dI96Zmm0wYQ7Q50LW0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-21-NwFBWKeEM-2DUNa-kYU-gQ-1; Wed, 27 Apr 2022 19:56:52 -0400 X-MC-Unique: NwFBWKeEM-2DUNa-kYU-gQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 82CA9811E75; Wed, 27 Apr 2022 23:56:51 +0000 (UTC) Received: from [10.22.11.251] (unknown [10.22.11.251]) by smtp.corp.redhat.com (Postfix) with ESMTP id DDA5A14152FB; Wed, 27 Apr 2022 23:56:50 +0000 (UTC) Message-ID: Date: Wed, 27 Apr 2022 19:56:50 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH] locking/rwsem: Allow slowpath writer to ignore handoff bit if not set by first waiter Content-Language: en-US To: John Donnelly , Peter Zijlstra , Ingo Molnar , Will Deacon , Boqun Feng Cc: linux-kernel@vger.kernel.org, Hillf Danton References: <20220427173124.1428050-1-longman@redhat.com> From: Waiman Long In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/27/22 19:16, John Donnelly wrote: > On 4/27/22 12:31 PM, Waiman Long wrote: >> With commit d257cc8cb8d5 ("locking/rwsem: Make handoff bit handling more >> consistent"), the writer that sets the handoff bit can be interrupted >> out without clearing the bit if the wait queue isn't empty. This >> disables >> reader and writer optimistic lock spinning and stealing. >> >> Now if a non-first writer in the queue is somehow woken up or first >> entering the waiting loop, it can't acquire the lock.  This is not >> the case before that commit as the writer that set the handoff bit >> will clear it when exiting out via the out_nolock path. This is less >> efficient as the busy rwsem stays in an unlock state for a longer time. >> >> This patch allows a non-first writer to ignore the handoff bit if it >> is not originally set or initiated by the first waiter. >> >> Fixes: d257cc8cb8d5 ("locking/rwsem: Make handoff bit handling more >> consistent") > > Hi Waiman, > > 1. You likely need : > > Cc: > > Since d257cc8cb8d5 has been migrated to other LTS threads (5.15.y for > sure) . Since the commit has a fixes tag, the stable will automatically pick it up. > > 2. I had posted this earlier: > > [PATCH 5.15 1/1] Revert "locking/rwsem: Make handoff bit handling more > consistent" > > That is likely not needed now. Right. The patch was created to fix a problem reported by another user. So reverting it may not the right move. > > > 3. Please add : > > Reported-by: Jorge Lopez > > We can likely test this, but I can't give a ETA when that will happen. > > >> Signed-off-by: Waiman Long > > Acked-by: John Donnelly Will add the that when I send out the next version. Cheers, Longman