Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp73733pxb; Tue, 17 Nov 2020 21:19:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJwd0DMSuUIHKcLX4tjyWNR9Wc9+ryJhNxc8KjNFb1F1FMP6Sr41gXzB3UGJA7wTgILJbJMw X-Received: by 2002:a17:906:5910:: with SMTP id h16mr1003388ejq.60.1605676740496; Tue, 17 Nov 2020 21:19:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605676740; cv=none; d=google.com; s=arc-20160816; b=hPB7aM0vlVuIUahsSD5hi7NQ0efBaZqHSiLhi49FelXiEoEEKxwAw2qrpqueykzjQQ yxq9+lRomFDPYJ/4+shcdStbD5HcPq8EWt1wbcxR0k6ySMmqhtmjp3JHNmSr9uiMQ2oa C0UTp/k5giSEcn7Dep58k6Gt6PF+9Q6ZxTP5SiZ9OSf7F4tvZR0Wp8puzwSyTEWh9nKx g1EhagWtukLatK5uMO6cGBPdoPy+w4HxrO6jg16tR+8Nhi0iqcmovMsuHMynDcuxDH2t O9YCygeEZD1od9liubob/AooLyUuA6aitn574QLFLYX2Eat9mpUWTjLhMekFvPQrG+x6 5otQ== 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=3lOxAf6DWuWM2pc7jbHkuvE65kHIPs1y5AIovopjAAQ=; b=CCg7VqKh0EQhLXY8l0tUlmgtrP9lcWIjRAF3xBZatc59vckm7cVySVLXxIM+b7HCMh RaMj4fpwmCrs52/mPYU/vsVpuQp52YlyFc8enJULur0byWlpx+/VoHB7VV+jEzPZLr79 ZTF8fBrFNy9rznUtEMXtJeR7PohT7r1Xgf5PRcMXEYhVTgGxMHIz9jzUi4FMWxvkvA52 evtEnkd/sK+sREYcAH2WA4QNQmO1TWnomVHhikzGSKXWtsWnkycJbfk9Is668YUN7Hhs OmhNdXLPnfpNAdMFtteZ8vdLvUnjcQ90EVKj+A2J2ADA8Qaen5Fe+fLwnEqp6XPJlQpv RWSw== 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 n27si1862224ejb.222.2020.11.17.21.18.37; Tue, 17 Nov 2020 21:19:00 -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 S1726310AbgKRFQx (ORCPT + 99 others); Wed, 18 Nov 2020 00:16:53 -0500 Received: from mx2.suse.de ([195.135.220.15]:48882 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726223AbgKRFQx (ORCPT ); Wed, 18 Nov 2020 00:16:53 -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 E22DBABDE; Wed, 18 Nov 2020 05:16:51 +0000 (UTC) Date: Tue, 17 Nov 2020 20:53:45 -0800 From: Davidlohr Bueso To: Waiman Long Cc: Peter Zijlstra , Ingo Molnar , Will Deacon , linux-kernel@vger.kernel.org, Phil Auld Subject: Re: [PATCH 4/5] locking/rwsem: Wake up all waiting readers if RWSEM_WAKE_READ_OWNED Message-ID: <20201118045345.hpw2fjmd247xpnwl@linux-p48b.lan> References: <20201118030429.23017-1-longman@redhat.com> <20201118030429.23017-5-longman@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20201118030429.23017-5-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: >The rwsem wakeup logic has been modified by commit d3681e269fff >("locking/rwsem: Wake up almost all readers in wait queue") to wake up >all readers in the wait queue if the first waiter is a reader. In the >case of RWSEM_WAKE_READ_OWNED, not all readers can be woken up if the >first waiter happens to be a writer. Complete the logic by waking up >all readers even for this case. While rwsems are certainly not fifo, I'm concerned this would give too much priority to the readers by having the reader owned lock just skip over the first waiter. And I'd say most users are more concerned about the writer side. Basically this would affect the phase-fair properties. Thanks, Davidlohr