]> git.baikalelectronics.ru Git - kernel.git/commit
rwsem: Add comments to explain the meaning of the rwsem's count field
authorTim Chen <tim.c.chen@linux.intel.com>
Fri, 2 May 2014 19:53:57 +0000 (12:53 -0700)
committerIngo Molnar <mingo@kernel.org>
Sun, 4 May 2014 18:34:26 +0000 (20:34 +0200)
commit5871f3e6a7187a431261b69b71c78d4e34d4b429
tree8e3814671a22470fc5156527f23877619f468594
parentdf6d012f57043603d585875464c0de71770a0c22
rwsem: Add comments to explain the meaning of the rwsem's count field

It took me quite a while to understand how rwsem's count field
mainifested itself in different scenarios.

Add comments to provide a quick reference to the the rwsem's count
field for each scenario where readers and writers are contending
for the lock.

Hopefully it will be useful for future maintenance of the code and
for people to get up to speed on how the logic in the code works.

Signed-off-by: Tim Chen <tim.c.chen@linux.intel.com>
Cc: Davidlohr Bueso <davidlohr@hp.com>
Cc: Alex Shi <alex.shi@linaro.org>
Cc: Michel Lespinasse <walken@google.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Peter Hurley <peter@hurleysoftware.com>
Cc: Paul E.McKenney <paulmck@linux.vnet.ibm.com>
Cc: Jason Low <jason.low2@hp.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/1399060437.2970.146.camel@schen9-DESK
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/locking/rwsem-xadd.c