Messages in this thread Patch in this message | | | From | Pranith Kumar <> | Subject | [PATCH v2 8/9] task_work: Replace smp_read_barrier_depends() with lockless_dereference() | Date | Fri, 21 Nov 2014 10:06:02 -0500 |
| |
Recently lockless_dereference() was added which can be used in place of hard-coding smp_read_barrier_depends(). The following PATCH makes the change.
Signed-off-by: Pranith Kumar <bobby.prani@gmail.com> --- kernel/task_work.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/kernel/task_work.c b/kernel/task_work.c index 8727032..b5599ce 100644 --- a/kernel/task_work.c +++ b/kernel/task_work.c @@ -62,8 +62,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 = ACCESS_ONCE(*pprev))) { - smp_read_barrier_depends(); + while ((work = lockless_dereference(*pprev))) { if (work->func != func) pprev = &work->next; else if (cmpxchg(pprev, work, work->next) == work) -- 1.9.1
| |