]> git.baikalelectronics.ru Git - kernel.git/commit
dcache: get/release read lock in read_seqbegin_or_lock() & friend
authorWaiman Long <Waiman.Long@hp.com>
Thu, 12 Sep 2013 14:55:35 +0000 (10:55 -0400)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 12 Sep 2013 16:25:23 +0000 (09:25 -0700)
commitfaad27e28da01f72fe52784da5df248bf8be65ea
tree25e3bccce50977e9199df4ee0445a3af9e5da708
parenta89c8c3487a2a4319992c3319f493c35b53cb607
dcache: get/release read lock in read_seqbegin_or_lock() & friend

This patch modifies read_seqbegin_or_lock() and need_seqretry() to use
newly introduced read_seqlock_excl() and read_sequnlock_excl()
primitives so that they won't change the sequence number even if they
fall back to take the lock.  This is OK as no change to the protected
data structure is being made.

It will prevent one fallback to lock taking from cascading into a series
of lock taking reducing performance because of the sequence number
change.  It will also allow other sequence readers to go forward while
an exclusive reader lock is taken.

This patch also updates some of the inaccurate comments in the code.

Signed-off-by: Waiman Long <Waiman.Long@hp.com>
To: Alexander Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/dcache.c