diff options
author | Peter Zijlstra <peterz@infradead.org> | 2019-10-30 20:17:51 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2020-02-11 13:10:54 +0100 |
commit | 71365d40232110f7b029befc9033ea311d680611 (patch) | |
tree | da9cf44abea7c38e244c2b2dd7e6ef587c4146dc /kernel/locking | |
parent | 206c98ffbeda588dbbd9d272505c42acbc364a30 (diff) | |
download | linux-stable-71365d40232110f7b029befc9033ea311d680611.tar.gz linux-stable-71365d40232110f7b029befc9033ea311d680611.tar.bz2 linux-stable-71365d40232110f7b029befc9033ea311d680611.zip |
locking/percpu-rwsem: Move __this_cpu_inc() into the slowpath
As preparation to rework __percpu_down_read() move the
__this_cpu_inc() into it.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Davidlohr Bueso <dbueso@suse.de>
Acked-by: Will Deacon <will@kernel.org>
Acked-by: Waiman Long <longman@redhat.com>
Tested-by: Juri Lelli <juri.lelli@redhat.com>
Link: https://lkml.kernel.org/r/20200131151540.041600199@infradead.org
Diffstat (limited to 'kernel/locking')
-rw-r--r-- | kernel/locking/percpu-rwsem.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/locking/percpu-rwsem.c b/kernel/locking/percpu-rwsem.c index 969389df6eee..becf925b27b5 100644 --- a/kernel/locking/percpu-rwsem.c +++ b/kernel/locking/percpu-rwsem.c @@ -47,6 +47,8 @@ EXPORT_SYMBOL_GPL(percpu_free_rwsem); bool __percpu_down_read(struct percpu_rw_semaphore *sem, bool try) { + __this_cpu_inc(*sem->read_count); + /* * Due to having preemption disabled the decrement happens on * the same CPU as the increment, avoiding the |