Thread (38 messages) 38 messages, 8 authors, 2020-03-27

Re: Documentation/locking/locktypes: Further clarifications and wordsmithing

From: "Paul E. McKenney" <paulmck@kernel.org>
Date: 2020-03-25 16:39:23
Also in: linux-acpi, linux-pci, linux-pm, linux-usb, linuxppc-dev, lkml, netdev, platform-driver-x86

On Wed, Mar 25, 2020 at 05:02:12PM +0100, Sebastian Siewior wrote:
On 2020-03-25 13:27:49 [+0100], Thomas Gleixner wrote:
quoted
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 <paulmck@kernel.org>
Signed-off-by: Paul McKenney <paulmck@kernel.org>
Signed-off-by: Thomas Gleixner <redacted>
Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
quoted
--- a/Documentation/locking/locktypes.rst
+++ b/Documentation/locking/locktypes.rst
quoted
+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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help