locking/percpu-rwsem: Add down_read_preempt_disable()
authorPeter Zijlstra <peterz@infradead.org>
Mon, 23 Nov 2015 14:23:55 +0000 (15:23 +0100)
committerIngo Molnar <mingo@kernel.org>
Thu, 22 Sep 2016 13:25:54 +0000 (15:25 +0200)
commit259d69b7f056bc9a543c7d184e791ef6c2775081
treee7db40679995eec5e61bc105e095db645d4e5f04
parent7c3f654d8e18942295eeda42f7d75494443980e0
locking/percpu-rwsem: Add down_read_preempt_disable()

Provide a down_read()/up_read() variant that keeps preemption disabled
over the whole thing, when possible.

This avoids a needless preemption point for constructs such as:

percpu_down_read(&global_rwsem);
spin_lock(&lock);
...
spin_unlock(&lock);
percpu_up_read(&global_rwsem);

Which perturbs timings. In particular it was found to cure a
performance regression in a follow up patch in fs/locks.c

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
include/linux/percpu-rwsem.h