[GIT PULL] workqueue fixes for v4.3-rc5

From: Tejun Heo
Date: Tue Oct 13 2015 - 17:50:01 EST


Hello, Linus.

Single patch to fix delayed work being queued on the wrong CPU. This
has been broken forever (v2.6.31+) but obviously doesn't trigger in
most configurations.

Thanks.

The following changes since commit 9ffecb10283508260936b96022d4ee43a7798b4c:

Linux 4.3-rc3 (2015-09-27 07:50:08 -0400)

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git for-4.3-fixes

for you to fetch changes up to 874bbfe600a660cba9c776b3957b1ce393151b76:

workqueue: make sure delayed work run in local cpu (2015-09-30 13:06:46 -0400)

----------------------------------------------------------------
Shaohua Li (1):
workqueue: make sure delayed work run in local cpu

kernel/workqueue.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index ca71582..bcb14ca 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -1458,13 +1458,13 @@ static void __queue_delayed_work(int cpu, struct workqueue_struct *wq,
timer_stats_timer_set_start_info(&dwork->timer);

dwork->wq = wq;
+ /* timer isn't guaranteed to run in this cpu, record earlier */
+ if (cpu == WORK_CPU_UNBOUND)
+ cpu = raw_smp_processor_id();
dwork->cpu = cpu;
timer->expires = jiffies + delay;

- if (unlikely(cpu != WORK_CPU_UNBOUND))
- add_timer_on(timer, cpu);
- else
- add_timer(timer);
+ add_timer_on(timer, cpu);
}

/**

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/