diff options
| author | Peter Zijlstra <peterz@infradead.org> | 2016-08-09 08:44:12 -0700 |
|---|---|---|
| committer | Dmitry Shmidt <dimitrysh@google.com> | 2016-08-26 09:37:34 -0700 |
| commit | 3228c5eb7af2b4cb981706b88ed3c3e81ab8e80a (patch) | |
| tree | 5ca5b701bdbdb259c23b2eb37f297d09f734a5f7 /kernel/fork.c | |
| parent | 75c591ea5787a59e69c8d2b803a7f4f0c29ec34e (diff) | |
RFC: FROMLIST: 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.
Mailing-list-URL: https://lkml.org/lkml/2016/8/9/181
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
[jstultz: Backported to 4.4]
Change-Id: I8ea04b4dca2ec36f1c2469eccafde1423490572f
Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'kernel/fork.c')
0 files changed, 0 insertions, 0 deletions
