From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DFA8CC1975A for ; Wed, 25 Mar 2020 16:39:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BF4902077D for ; Wed, 25 Mar 2020 16:39:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585154364; bh=A1GPX4wlECfGGG7gTSHHrGt3spoxTdKZ1xy9utwV/BA=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:List-ID: From; b=bh5hLg+bNJdJIia42ydD9rENmqEg5elG40tzIOD3jyL55dN/Ug8eNkAS41fBgwOCI NJJWSaJiPtRYSwj54Jv9bWLwDppagi9YpLK10LqTbsKwEzEf3SlAaHT9yzTXOEaCjR t6boIZI5qyF8AVrUn8Wtjkm8R1HYThTyV6i7zjdk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727711AbgCYQjV (ORCPT ); Wed, 25 Mar 2020 12:39:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:39030 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727464AbgCYQjU (ORCPT ); Wed, 25 Mar 2020 12:39:20 -0400 Received: from paulmck-ThinkPad-P72.home (50-39-105-78.bvtn.or.frontiernet.net [50.39.105.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6311D2073E; Wed, 25 Mar 2020 16:39:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585154359; bh=A1GPX4wlECfGGG7gTSHHrGt3spoxTdKZ1xy9utwV/BA=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=APOdz2w7EH+7D58vqGoNgP8mOHfbNma8Ty1WIG8jpBICPSinl9OycWqb0OdtxkciV gxpkAVRwhIe+WxIGCYwXBH73yF99ZY9v+QEk7Sp75Ev8c6B1ujrOAxGnV4ZUKw4afx Pt8nI6CO51v4M2JmrHTqBAusgH99DwWPqLUsLFTU= Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id 325E9352094D; Wed, 25 Mar 2020 09:39:19 -0700 (PDT) Date: Wed, 25 Mar 2020 09:39:19 -0700 From: "Paul E. McKenney" To: Sebastian Siewior Cc: Thomas Gleixner , LKML , Peter Zijlstra , Ingo Molnar , Linus Torvalds , Joel Fernandes , Oleg Nesterov , Davidlohr Bueso , Jonathan Corbet , Randy Dunlap , Logan Gunthorpe , Bjorn Helgaas , Kurt Schwemmer , linux-pci@vger.kernel.org, Greg Kroah-Hartman , Felipe Balbi , linux-usb@vger.kernel.org, Kalle Valo , "David S. Miller" , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Darren Hart , Andy Shevchenko , platform-driver-x86@vger.kernel.org, Zhang Rui , "Rafael J. Wysocki" , linux-pm@vger.kernel.org, Len Brown , linux-acpi@vger.kernel.org, kbuild test robot , Nick Hu , Greentime Hu , Vincent Chen , Guo Ren , linux-csky@vger.kernel.org, Brian Cain , linux-hexagon@vger.kernel.org, Tony Luck , Fenghua Yu , linux-ia64@vger.kernel.org, Michal Simek , Michael Ellerman , Arnd Bergmann , Geoff Levand , linuxppc-dev@lists.ozlabs.org, Davidlohr Bueso Subject: Re: Documentation/locking/locktypes: Further clarifications and wordsmithing Message-ID: <20200325163919.GU19865@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <20200323025501.GE3199@paulmck-ThinkPad-P72> <87r1xhz6qp.fsf@nanos.tec.linutronix.de> <20200325002811.GO19865@paulmck-ThinkPad-P72> <87wo78y5yy.fsf@nanos.tec.linutronix.de> <20200325160212.oavrni7gmzudnczv@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200325160212.oavrni7gmzudnczv@linutronix.de> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Wed, Mar 25, 2020 at 05:02:12PM +0100, Sebastian Siewior wrote: > On 2020-03-25 13:27:49 [+0100], Thomas Gleixner wrote: > > The documentation of rw_semaphores is wrong as it claims that the non-owner > > reader release is not supported by RT. That's just history biased memory > > distortion. > > > > Split the 'Owner semantics' section up and add separate sections for > > semaphore and rw_semaphore to reflect reality. > > > > Aside of that the following updates are done: > > > > - Add pseudo code to document the spinlock state preserving mechanism on > > PREEMPT_RT > > > > - Wordsmith the bitspinlock and lock nesting sections > > > > Co-developed-by: Paul McKenney > > Signed-off-by: Paul McKenney > > Signed-off-by: Thomas Gleixner > Acked-by: Sebastian Andrzej Siewior > > > --- a/Documentation/locking/locktypes.rst > > +++ b/Documentation/locking/locktypes.rst > … > > +rw_semaphore > > +============ > > + > > +rw_semaphore is a multiple readers and single writer lock mechanism. > > + > > +On non-PREEMPT_RT kernels the implementation is fair, thus preventing > > +writer starvation. > > + > > +rw_semaphore complies by default with the strict owner semantics, but there > > +exist special-purpose interfaces that allow non-owner release for readers. > > +These work independent of the kernel configuration. > > This reads funny, could be my English. "This works independent …" maybe? The "These" refers to "interfaces", which is plural, so "These" rather than "This". But yes, it is a bit awkward, because you have to skip back past "readers", "release", and "non-owner" to find the implied subject of that last sentence. So how about this instead, making the implied subject explicit? rw_semaphore complies by default with the strict owner semantics, but there exist special-purpose interfaces that allow non-owner release for readers. These interfaces work independent of the kernel configuration. Thanx, Paul From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Paul E. McKenney" Subject: Re: Documentation/locking/locktypes: Further clarifications and wordsmithing Date: Wed, 25 Mar 2020 09:39:19 -0700 Message-ID: <20200325163919.GU19865@paulmck-ThinkPad-P72> References: <20200323025501.GE3199@paulmck-ThinkPad-P72> <87r1xhz6qp.fsf@nanos.tec.linutronix.de> <20200325002811.GO19865@paulmck-ThinkPad-P72> <87wo78y5yy.fsf@nanos.tec.linutronix.de> <20200325160212.oavrni7gmzudnczv@linutronix.de> Reply-To: paulmck@kernel.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Content-Disposition: inline In-Reply-To: <20200325160212.oavrni7gmzudnczv@linutronix.de> Sender: netdev-owner@vger.kernel.org To: Sebastian Siewior Cc: Thomas Gleixner , LKML , Peter Zijlstra , Ingo Molnar , Linus Torvalds , Joel Fernandes , Oleg Nesterov , Davidlohr Bueso , Jonathan Corbet , Randy Dunlap , Logan Gunthorpe , Bjorn Helgaas , Kurt Schwemmer , linux-pci@vger.kernel.org, Greg Kroah-Hartman , Felipe Balbi , linux-usb@vger.kernel.org, Kalle Valo , "David S. Miller" , linux-wireless@vger.kernel.org, netdev@v List-Id: platform-driver-x86.vger.kernel.org On Wed, Mar 25, 2020 at 05:02:12PM +0100, Sebastian Siewior wrote: > On 2020-03-25 13:27:49 [+0100], Thomas Gleixner wrote: > > The documentation of rw_semaphores is wrong as it claims that the non-owner > > reader release is not supported by RT. That's just history biased memory > > distortion. > > > > Split the 'Owner semantics' section up and add separate sections for > > semaphore and rw_semaphore to reflect reality. > > > > Aside of that the following updates are done: > > > > - Add pseudo code to document the spinlock state preserving mechanism on > > PREEMPT_RT > > > > - Wordsmith the bitspinlock and lock nesting sections > > > > Co-developed-by: Paul McKenney > > Signed-off-by: Paul McKenney > > Signed-off-by: Thomas Gleixner > Acked-by: Sebastian Andrzej Siewior > > > --- a/Documentation/locking/locktypes.rst > > +++ b/Documentation/locking/locktypes.rst > … > > +rw_semaphore > > +============ > > + > > +rw_semaphore is a multiple readers and single writer lock mechanism. > > + > > +On non-PREEMPT_RT kernels the implementation is fair, thus preventing > > +writer starvation. > > + > > +rw_semaphore complies by default with the strict owner semantics, but there > > +exist special-purpose interfaces that allow non-owner release for readers. > > +These work independent of the kernel configuration. > > This reads funny, could be my English. "This works independent …" maybe? The "These" refers to "interfaces", which is plural, so "These" rather than "This". But yes, it is a bit awkward, because you have to skip back past "readers", "release", and "non-owner" to find the implied subject of that last sentence. So how about this instead, making the implied subject explicit? rw_semaphore complies by default with the strict owner semantics, but there exist special-purpose interfaces that allow non-owner release for readers. These interfaces work independent of the kernel configuration. Thanx, Paul From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8273C54FCF for ; Wed, 25 Mar 2020 16:41:56 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 831F320774 for ; Wed, 25 Mar 2020 16:41:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="APOdz2w7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 831F320774 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 48nYmf1sdzzDqfZ for ; Thu, 26 Mar 2020 03:41:54 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=198.145.29.99; helo=mail.kernel.org; envelope-from=srs0=hi2+=5k=paulmck-thinkpad-p72.home=paulmck@kernel.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=default header.b=APOdz2w7; dkim-atps=neutral Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 48nYjk2LqdzDqWs for ; Thu, 26 Mar 2020 03:39:21 +1100 (AEDT) Received: from paulmck-ThinkPad-P72.home (50-39-105-78.bvtn.or.frontiernet.net [50.39.105.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6311D2073E; Wed, 25 Mar 2020 16:39:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585154359; bh=A1GPX4wlECfGGG7gTSHHrGt3spoxTdKZ1xy9utwV/BA=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=APOdz2w7EH+7D58vqGoNgP8mOHfbNma8Ty1WIG8jpBICPSinl9OycWqb0OdtxkciV gxpkAVRwhIe+WxIGCYwXBH73yF99ZY9v+QEk7Sp75Ev8c6B1ujrOAxGnV4ZUKw4afx Pt8nI6CO51v4M2JmrHTqBAusgH99DwWPqLUsLFTU= Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id 325E9352094D; Wed, 25 Mar 2020 09:39:19 -0700 (PDT) Date: Wed, 25 Mar 2020 09:39:19 -0700 From: "Paul E. McKenney" To: Sebastian Siewior Subject: Re: Documentation/locking/locktypes: Further clarifications and wordsmithing Message-ID: <20200325163919.GU19865@paulmck-ThinkPad-P72> References: <20200323025501.GE3199@paulmck-ThinkPad-P72> <87r1xhz6qp.fsf@nanos.tec.linutronix.de> <20200325002811.GO19865@paulmck-ThinkPad-P72> <87wo78y5yy.fsf@nanos.tec.linutronix.de> <20200325160212.oavrni7gmzudnczv@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200325160212.oavrni7gmzudnczv@linutronix.de> User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: paulmck@kernel.org Cc: linux-usb@vger.kernel.org, linux-ia64@vger.kernel.org, Peter Zijlstra , linux-pci@vger.kernel.org, Oleg Nesterov , Guo Ren , Joel Fernandes , Vincent Chen , Thomas Gleixner , Davidlohr Bueso , linux-acpi@vger.kernel.org, Brian Cain , Jonathan Corbet , linux-hexagon@vger.kernel.org, "Rafael J. Wysocki" , linux-csky@vger.kernel.org, Ingo Molnar , Linus Torvalds , Darren Hart , Zhang Rui , Len Brown , Fenghua Yu , Arnd Bergmann , linux-pm@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Greentime Hu , Bjorn Helgaas , Kurt Schwemmer , platform-driver-x86@vger.kernel.org, Kalle Valo , kbuild test robot , Felipe Balbi , Michal Simek , Tony Luck , Nick Hu , Geoff Levand , Greg Kroah-Hartman , Randy Dunlap , linux-wireless@vger.kernel.org, LKML , Davidlohr Bueso , netdev@vger.kernel.org, Logan Gunthorpe , "David S. Miller" , Andy Shevchenko Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Wed, Mar 25, 2020 at 05:02:12PM +0100, Sebastian Siewior wrote: > On 2020-03-25 13:27:49 [+0100], Thomas Gleixner wrote: > > The documentation of rw_semaphores is wrong as it claims that the non-owner > > reader release is not supported by RT. That's just history biased memory > > distortion. > > > > Split the 'Owner semantics' section up and add separate sections for > > semaphore and rw_semaphore to reflect reality. > > > > Aside of that the following updates are done: > > > > - Add pseudo code to document the spinlock state preserving mechanism on > > PREEMPT_RT > > > > - Wordsmith the bitspinlock and lock nesting sections > > > > Co-developed-by: Paul McKenney > > Signed-off-by: Paul McKenney > > Signed-off-by: Thomas Gleixner > Acked-by: Sebastian Andrzej Siewior > > > --- a/Documentation/locking/locktypes.rst > > +++ b/Documentation/locking/locktypes.rst > … > > +rw_semaphore > > +============ > > + > > +rw_semaphore is a multiple readers and single writer lock mechanism. > > + > > +On non-PREEMPT_RT kernels the implementation is fair, thus preventing > > +writer starvation. > > + > > +rw_semaphore complies by default with the strict owner semantics, but there > > +exist special-purpose interfaces that allow non-owner release for readers. > > +These work independent of the kernel configuration. > > This reads funny, could be my English. "This works independent …" maybe? The "These" refers to "interfaces", which is plural, so "These" rather than "This". But yes, it is a bit awkward, because you have to skip back past "readers", "release", and "non-owner" to find the implied subject of that last sentence. So how about this instead, making the implied subject explicit? rw_semaphore complies by default with the strict owner semantics, but there exist special-purpose interfaces that allow non-owner release for readers. These interfaces work independent of the kernel configuration. Thanx, Paul From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Paul E. McKenney" Date: Wed, 25 Mar 2020 16:39:19 +0000 Subject: Re: Documentation/locking/locktypes: Further clarifications and wordsmithing Message-Id: <20200325163919.GU19865@paulmck-ThinkPad-P72> List-Id: References: <20200323025501.GE3199@paulmck-ThinkPad-P72> <87r1xhz6qp.fsf@nanos.tec.linutronix.de> <20200325002811.GO19865@paulmck-ThinkPad-P72> <87wo78y5yy.fsf@nanos.tec.linutronix.de> <20200325160212.oavrni7gmzudnczv@linutronix.de> In-Reply-To: <20200325160212.oavrni7gmzudnczv@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: Sebastian Siewior Cc: Thomas Gleixner , LKML , Peter Zijlstra , Ingo Molnar , Linus Torvalds , Joel Fernandes , Oleg Nesterov , Davidlohr Bueso , Jonathan Corbet , Randy Dunlap , Logan Gunthorpe , Bjorn Helgaas , Kurt Schwemmer , linux-pci@vger.kernel.org, Greg Kroah-Hartman , Felipe Balbi , linux-usb@vger.kernel.org, Kalle Valo , "David S. Miller" , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Darren Hart , Andy Shevchenko , platform-driver-x86@vger.kernel.org, Zhang Rui , "Rafael J. Wysocki" , linux-pm@vger.kernel.org, Len Brown , linux-acpi@vger.kernel.org, kbuild test robot , Nick Hu , Greentime Hu , Vincent Chen , Guo Ren , linux-csky@vger.kernel.org, Brian Cain , linux-hexagon@vger.kernel.org, Tony Luck , Fenghua Yu , linux-ia64@vger.kernel.org, Michal Simek , Michael Ellerman , Arnd Bergmann , Geoff Levand , linuxppc-dev@lists.ozlabs.org, Davidlohr Bueso On Wed, Mar 25, 2020 at 05:02:12PM +0100, Sebastian Siewior wrote: > On 2020-03-25 13:27:49 [+0100], Thomas Gleixner wrote: > > The documentation of rw_semaphores is wrong as it claims that the non-owner > > reader release is not supported by RT. That's just history biased memory > > distortion. > > > > Split the 'Owner semantics' section up and add separate sections for > > semaphore and rw_semaphore to reflect reality. > > > > Aside of that the following updates are done: > > > > - Add pseudo code to document the spinlock state preserving mechanism on > > PREEMPT_RT > > > > - Wordsmith the bitspinlock and lock nesting sections > > > > Co-developed-by: Paul McKenney > > Signed-off-by: Paul McKenney > > Signed-off-by: Thomas Gleixner > Acked-by: Sebastian Andrzej Siewior > > > --- a/Documentation/locking/locktypes.rst > > +++ b/Documentation/locking/locktypes.rst > … > > +rw_semaphore > > +====== > > + > > +rw_semaphore is a multiple readers and single writer lock mechanism. > > + > > +On non-PREEMPT_RT kernels the implementation is fair, thus preventing > > +writer starvation. > > + > > +rw_semaphore complies by default with the strict owner semantics, but there > > +exist special-purpose interfaces that allow non-owner release for readers. > > +These work independent of the kernel configuration. > > This reads funny, could be my English. "This works independent …" maybe? The "These" refers to "interfaces", which is plural, so "These" rather than "This". But yes, it is a bit awkward, because you have to skip back past "readers", "release", and "non-owner" to find the implied subject of that last sentence. So how about this instead, making the implied subject explicit? rw_semaphore complies by default with the strict owner semantics, but there exist special-purpose interfaces that allow non-owner release for readers. These interfaces work independent of the kernel configuration. Thanx, Paul