1
0
Fork 0
alistair23-linux/kernel/rcu
Peter Zijlstra 80127a3968 locking/percpu-rwsem: Optimize readers and reduce global impact
Currently the percpu-rwsem switches to (global) atomic ops while a
writer is waiting; which could be quite a while and slows down
releasing the readers.

This patch cures this problem by ordering the reader-state vs
reader-count (see the comments in __percpu_down_read() and
percpu_down_write()). This changes a global atomic op into a full
memory barrier, which doesn't have the global cacheline contention.

This also enables using the percpu-rwsem with rcu_sync disabled in order
to bias the implementation differently, reducing the writer latency by
adding some cost to readers.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
[ Fixed modular build. ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2016-08-10 14:34:01 +02:00
..
Makefile rcutorture: Add RCU grace-period performance tests 2016-03-31 13:37:38 -07:00
rcu.h tiny_rcu: Directly force QS when call_rcu_[bh|sched]() on idle_task 2015-01-06 11:01:12 -08:00
rcuperf.c rcutorture: Fix error return code in rcu_perf_init() 2016-06-14 16:03:32 -07:00
rcutorture.c Merge branches 'doc.2016.06.15a', 'fixes.2016.06.15b' and 'torture.2016.06.14a' into HEAD 2016-06-15 16:58:03 -07:00
srcu.c rcu: Add rcu_normal kernel parameter to suppress expediting 2015-12-04 12:26:53 -08:00
sync.c locking/percpu-rwsem: Optimize readers and reduce global impact 2016-08-10 14:34:01 +02:00
tiny.c rcu: Use rcu_callback_t in call_rcu*() and friends 2015-10-06 11:08:05 -07:00
tiny_plugin.h rcu: Make rcu/tiny_plugin.h explicitly non-modular 2016-02-23 19:59:55 -08:00
tree.c rcu: Convert rcutree to hotplug state machine 2016-07-15 10:41:44 +02:00
tree.h rcu: Correctly handle sparse possible cpus 2016-06-15 16:00:05 -07:00
tree_exp.h Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-07-25 12:41:29 -07:00
tree_plugin.h Merge branches 'doc.2016.06.15a', 'fixes.2016.06.15b' and 'torture.2016.06.14a' into HEAD 2016-06-15 16:58:03 -07:00
tree_trace.c rcu: Shorten expedited_workdone* to exp_workdone* 2016-03-31 13:34:08 -07:00
update.c rcu: Make call_rcu_tasks() tolerate first call with irqs disabled 2016-06-15 15:45:00 -07:00