diff options
author | Will Deacon <will.deacon@arm.com> | 2017-10-24 11:22:48 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2017-10-24 13:17:33 +0200 |
commit | 506458efaf153c1ea480591c5602a5a3ba5a3b76 (patch) | |
tree | c4ac0a89bf23993036720ec8883fff0740bf9019 /kernel/task_work.c | |
parent | 76ebbe78f7390aee075a7f3768af197ded1bdfbb (diff) | |
download | linux-506458efaf153c1ea480591c5602a5a3ba5a3b76.tar.gz linux-506458efaf153c1ea480591c5602a5a3ba5a3b76.tar.bz2 linux-506458efaf153c1ea480591c5602a5a3ba5a3b76.zip |
locking/barriers: Convert users of lockless_dereference() to READ_ONCE()
READ_ONCE() now has an implicit smp_read_barrier_depends() call, so it
can be used instead of lockless_dereference() without any change in
semantics.
Signed-off-by: Will Deacon <will.deacon@arm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1508840570-22169-4-git-send-email-will.deacon@arm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/task_work.c')
-rw-r--r-- | kernel/task_work.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/task_work.c b/kernel/task_work.c index 836a72a66fba..9a9f262fc53d 100644 --- a/kernel/task_work.c +++ b/kernel/task_work.c @@ -67,7 +67,7 @@ task_work_cancel(struct task_struct *task, task_work_func_t func) * we raced with task_work_run(), *pprev == NULL/exited. */ raw_spin_lock_irqsave(&task->pi_lock, flags); - while ((work = lockless_dereference(*pprev))) { + while ((work = READ_ONCE(*pprev))) { if (work->func != func) pprev = &work->next; else if (cmpxchg(pprev, work, work->next) == work) |