mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 22:37:45 -04:00
Revert "workqueue: make sure delayed work run in local cpu"
This reverts commit874bbfe600. Workqueue used to implicity guarantee that work items queued without explicit CPU specified are put on the local CPU. Recent changes in timer broke the guarantee and led to vmstat breakage which was fixed by176bed1de5("vmstat: explicitly schedule per-cpu work on the CPU we need it to run on"). vmstat is the most likely to expose the issue and it's quite possible that there are other similar problems which are a lot more difficult to trigger. As a preventive measure,874bbfe600("workqueue: make sure delayed work run in local cpu") was applied to restore the local CPU guarnatee. Unfortunately, the change exposed a bug in timer code which got fixed by22b886dd10("timers: Use proper base migration in add_timer_on()"). Due to code restructuring, the commit couldn't be backported beyond certain point and stable kernels which only had874bbfe600started crashing. The local CPU guarantee was accidental more than anything else and we want to get rid of it anyway. As, with the vmstat case fixed,874bbfe600is causing more problems than it's fixing, it has been decided to take the chance and officially break the guarantee by reverting the commit. A debug feature will be added to force foreign CPU assignment to expose cases relying on the guarantee and fixes for the individual cases will be backported to stable as necessary. Signed-off-by: Tejun Heo <[email protected]> Fixes:874bbfe600("workqueue: make sure delayed work run in local cpu") Link: http://lkml.kernel.org/g/[email protected] Cc: [email protected] Cc: Mike Galbraith <[email protected]> Cc: Henrique de Moraes Holschuh <[email protected]> Cc: Daniel Bilik <[email protected]> Cc: Jan Kara <[email protected]> Cc: Shaohua Li <[email protected]> Cc: Sasha Levin <[email protected]> Cc: Ben Hutchings <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Daniel Bilik <[email protected]> Cc: Jiri Slaby <[email protected]> Cc: Michal Hocko <[email protected]>
This commit is contained in:
1 parent
23d11a58a9
commit
041bd12e27
1 file changed
+4
-4
+4
-4
@@ -1464,13 +1464,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;
|
||||
|
||||
add_timer_on(timer, cpu);
|
||||
if (unlikely(cpu != WORK_CPU_UNBOUND))
|
||||
add_timer_on(timer, cpu);
|
||||
else
|
||||
add_timer(timer);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user