aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/workqueue.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index de429ba000ee..c4feef9798ea 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -1225,14 +1225,15 @@ static void __queue_work(unsigned int cpu, struct workqueue_struct *wq,
1225 cpu = raw_smp_processor_id(); 1225 cpu = raw_smp_processor_id();
1226 1226
1227 /* 1227 /*
1228 * It's multi cpu. If @wq is non-reentrant and @work 1228 * It's multi cpu. If @work was previously on a different
1229 * was previously on a different cpu, it might still 1229 * cpu, it might still be running there, in which case the
1230 * be running there, in which case the work needs to 1230 * work needs to be queued on that cpu to guarantee
1231 * be queued on that cpu to guarantee non-reentrance. 1231 * non-reentrancy.
1232 */ 1232 */
1233 gcwq = get_gcwq(cpu); 1233 gcwq = get_gcwq(cpu);
1234 if (wq->flags & WQ_NON_REENTRANT && 1234 last_gcwq = get_work_gcwq(work);
1235 (last_gcwq = get_work_gcwq(work)) && last_gcwq != gcwq) { 1235
1236 if (last_gcwq && last_gcwq != gcwq) {
1236 struct worker *worker; 1237 struct worker *worker;
1237 1238
1238 spin_lock(&last_gcwq->lock); 1239 spin_lock(&last_gcwq->lock);