[linux] 02/02: Revert "workqueue: make sure delayed work run in local cpu"

debian-kernel at lists.debian.org debian-kernel at lists.debian.org
Sat Feb 13 00:30:57 UTC 2016


This is an automated email from the git hooks/post-receive script.

benh pushed a commit to branch sid
in repository linux.

commit 2d5f78b62a713126e119a3078c3ed0efad65d917
Author: Ben Hutchings <ben at decadent.org.uk>
Date:   Sat Feb 13 00:03:31 2016 +0000

    Revert "workqueue: make sure delayed work run in local cpu"
    
    This caused a regression in 4.3
---
 debian/changelog                                   |  2 +
 ...e-make-sure-delayed-work-run-in-local-cpu.patch | 70 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 3 files changed, 73 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 18a50f8..53349da 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,8 @@ linux (4.4.1-1) UNRELEASED; urgency=medium
     (regression in 4.3)
   * af_unix: Guard against other == sk in unix_dgram_sendmsg
     (regression in 4.2.6-2)
+  * Revert "workqueue: make sure delayed work run in local cpu"
+    (regression in 4.3)
 
  -- Ben Hutchings <ben at decadent.org.uk>  Fri, 12 Feb 2016 23:34:23 +0000
 
diff --git a/debian/patches/bugfix/all/revert-workqueue-make-sure-delayed-work-run-in-local-cpu.patch b/debian/patches/bugfix/all/revert-workqueue-make-sure-delayed-work-run-in-local-cpu.patch
new file mode 100644
index 0000000..55090c6
--- /dev/null
+++ b/debian/patches/bugfix/all/revert-workqueue-make-sure-delayed-work-run-in-local-cpu.patch
@@ -0,0 +1,70 @@
+From: Tejun Heo <tj at kernel.org>
+Date: Tue,  9 Feb 2016 18:14:48 -0500
+Subject: Revert "workqueue: make sure delayed work run in local cpu"
+Origin: http://mid.gmane.org/1455059690-18765-2-git-send-email-tj@kernel.org
+
+This reverts commit 874bbfe600a660cba9c776b3957b1ce393151b76.
+
+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
+by 176bed1de5bf ("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, 874bbfe600a6 ("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 by 22b886dd1018 ("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 had
+874bbfe600a6 started 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,
+874bbfe600a6 is 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 <tj at kernel.org>
+Fixes: 874bbfe600a6 ("workqueue: make sure delayed work run in local cpu")
+Link: http://lkml.kernel.org/g/20160120211926.GJ10810@quack.suse.cz
+Cc: stable at vger.kernel.org
+Cc: Mike Galbraith <umgwanakikbuti at gmail.com>
+Cc: Henrique de Moraes Holschuh <hmh at hmh.eng.br>
+Cc: Daniel Bilik <daniel.bilik at neosystem.cz>
+Cc: Jan Kara <jack at suse.cz>
+Cc: Shaohua Li <shli at fb.com>
+Cc: Sasha Levin <sasha.levin at oracle.com>
+Cc: Ben Hutchings <ben at decadent.org.uk>
+Cc: Thomas Gleixner <tglx at linutronix.de>
+Cc: Daniel Bilik <daniel.bilik at neosystem.cz>
+Cc: Jiri Slaby <jslaby at suse.cz>
+Cc: Michal Hocko <mhocko at kernel.org>
+---
+ kernel/workqueue.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+--- a/kernel/workqueue.c
++++ b/kernel/workqueue.c
+@@ -1458,13 +1458,13 @@ static void __queue_delayed_work(int cpu
+ 	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);
+ }
+ 
+ /**
diff --git a/debian/patches/series b/debian/patches/series
index 499c27d..ae6e0cc 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -120,3 +120,4 @@ bugfix/all/pipe-limit-the-per-user-amount-of-pages-allocated-in.patch
 bugfix/all/iw_cxgb3-Fix-incorrectly-returning-error-on-success.patch
 bugfix/all/fs-hugetlbfs-inode.c-fix-bugs-in-hugetlb_vmtruncate_.patch
 bugfix/all/af_unix-guard-against-other-sk-in-unix_dgram_sendmsg.patch
+bugfix/all/revert-workqueue-make-sure-delayed-work-run-in-local-cpu.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/linux.git



More information about the Kernel-svn-changes mailing list