Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2942267pxu; Mon, 7 Dec 2020 22:12:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJyQE19pugFXs0d1baRThF8gyMe1atV2tiDyvsRvlaVoOe3i7ENlAqFL4StR4sXYMHF+TzeK X-Received: by 2002:a05:6402:ca1:: with SMTP id cn1mr14291811edb.128.1607407958849; Mon, 07 Dec 2020 22:12:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607407958; cv=none; d=google.com; s=arc-20160816; b=Yf+6JapStnDyXjGE/3FZcl113b6Q9WptRetH5CX2BenDzaW2yUhLCViBsu9vnbZXmu 2OuI4vOuGa/xKg5HptvqrdVpEC1inweIqjSUKBBtSEessW/SX28Rl7xVQdlg+TJMxmeo 8xzVs/zwQNOZkpGdY1oWAO5PDmctAgMNB8+wVkm7txgtAH7gg+65v+DG+o0MiZYcY0qW cAV9dfmaUo8JKQCQpLycFknj2zxtZ7qG0uA3iR7oRNrq6MlYo/vwIMzYw3ICDweeM4GN WSYJqVqKHYFH/InRSGWuhGeVGGdTFS771AsTNZUftQHiXpnOxEI8TLIpGhqxMJjCvjbN 44LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=v1qWHg6cQdE7eWpTG8p+2SOF20+c7JRcYtyF7Z7ekRs=; b=i81bJm7cJYs8W0LOyOOov8ZT6nNt9iQ3f0gSXmsKc5N0P3u1o3IbVSEw4wH338bwHJ 4wNw0/41YLnhQPSWUW/pgiSF4DvstDs0Urs+nrMrmlBEy/PvYHR3+n+3ybG09BGreHOZ cUm43M9o4b36S3MaFdDPh9ukoTzjg35P7vWaY1Lqim3GwiHv3O0CWUbInemN2WX753dh 06BzNCyGRB/Hd82MgAGsIGXRbT0sctpkBC15x6cn9O8ISORaYc/WFrB5RZX4WEV9tAF1 +Y+0jXOi76WA1hFJTKwxJLK+wY5CAhEWNwp8Xb15lBxj8BOUY9QE6HsjkKklaiv12NeR kcJQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q16si7881982ejd.199.2020.12.07.22.12.07; Mon, 07 Dec 2020 22:12:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727006AbgLHETN (ORCPT + 99 others); Mon, 7 Dec 2020 23:19:13 -0500 Received: from mx2.suse.de ([195.135.220.15]:38866 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726883AbgLHETN (ORCPT ); Mon, 7 Dec 2020 23:19:13 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 326C2AC9A; Tue, 8 Dec 2020 04:18:32 +0000 (UTC) Date: Mon, 7 Dec 2020 19:53:14 -0800 From: Davidlohr Bueso To: Waiman Long Cc: Peter Zijlstra , Ingo Molnar , Will Deacon , linux-kernel@vger.kernel.org, Phil Auld Subject: Re: [PATCH 3/5] locking/rwsem: Enable reader optimistic lock stealing Message-ID: <20201208035314.rwz72kgn5apr2whm@linux-p48b> References: <20201118030429.23017-1-longman@redhat.com> <20201118030429.23017-4-longman@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20201118030429.23017-4-longman@redhat.com> User-Agent: NeoMutt/20180716 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 17 Nov 2020, Waiman Long wrote: >If the optimistic spinning queue is empty and the rwsem does not have >the handoff or write-lock bits set, it is actually not necessary to >call rwsem_optimistic_spin() to spin on it. Instead, it can steal the >lock directly as its reader bias is in the count already. If it is >the first reader in this state, it will try to wake up other readers >in the wait queue. > >Signed-off-by: Waiman Long Reviewed-by: Davidlohr Bueso