aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/task_work.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2017-08-21 03:45:19 -0400
committerIngo Molnar <mingo@kernel.org>2017-08-21 03:45:19 -0400
commit94edf6f3c20c9c8ee301bde04150a91bab4bf32c (patch)
tree4a2af658258cf42fde24c1224e44c3e6a18c2792 /kernel/task_work.c
parentd5da6457bfadf64ff78f1816ae8329dbbba19513 (diff)
parent656e7c0c0a2e8d899f87fd7f081ea7a711146604 (diff)
Merge branch 'for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu into core/rcu
Pull RCU updates from Paul E. McKenney: - Removal of spin_unlock_wait() - SRCU updates - Torture-test updates - Documentation updates - Miscellaneous fixes - CPU-hotplug fixes - Miscellaneous non-RCU fixes Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/task_work.c')
-rw-r--r--kernel/task_work.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/kernel/task_work.c b/kernel/task_work.c
index d513051fcca2..836a72a66fba 100644
--- a/kernel/task_work.c
+++ b/kernel/task_work.c
@@ -96,20 +96,16 @@ void task_work_run(void)
96 * work->func() can do task_work_add(), do not set 96 * work->func() can do task_work_add(), do not set
97 * work_exited unless the list is empty. 97 * work_exited unless the list is empty.
98 */ 98 */
99 raw_spin_lock_irq(&task->pi_lock);
99 do { 100 do {
100 work = READ_ONCE(task->task_works); 101 work = READ_ONCE(task->task_works);
101 head = !work && (task->flags & PF_EXITING) ? 102 head = !work && (task->flags & PF_EXITING) ?
102 &work_exited : NULL; 103 &work_exited : NULL;
103 } while (cmpxchg(&task->task_works, work, head) != work); 104 } while (cmpxchg(&task->task_works, work, head) != work);
105 raw_spin_unlock_irq(&task->pi_lock);
104 106
105 if (!work) 107 if (!work)
106 break; 108 break;
107 /*
108 * Synchronize with task_work_cancel(). It can't remove
109 * the first entry == work, cmpxchg(task_works) should
110 * fail, but it can play with *work and other entries.
111 */
112 raw_spin_unlock_wait(&task->pi_lock);
113 109
114 do { 110 do {
115 next = work->next; 111 next = work->next;