]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
.37 patches
authorGreg Kroah-Hartman <gregkh@suse.de>
Fri, 18 Feb 2011 21:33:46 +0000 (13:33 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 18 Feb 2011 21:33:46 +0000 (13:33 -0800)
queue-2.6.37/series
queue-2.6.37/workqueue-make-sure-mayday_initial_timeout-is-at-least-2-jiffies-long.patch [new file with mode: 0644]
queue-2.6.37/workqueue-wake-up-a-worker-when-a-rescuer-is-leaving-a-gcwq.patch [new file with mode: 0644]

index b00e808346590864acef70265569b9541c49cd05..a88b4ea5a5db21a546f20cc2d8601effb8f7d158 100644 (file)
@@ -36,3 +36,5 @@ x86-mrst-set-correct-apb-timer-irq-affinity-for-secondary-cpu.patch
 pm-hibernate-return-error-code-when-alloc_image_page-fails.patch
 drm-radeon-kms-add-missing-frac-fb-div-flag-for-dce4.patch
 fs-partitions-validate-map_count-in-mac-partition-tables.patch
+workqueue-wake-up-a-worker-when-a-rescuer-is-leaving-a-gcwq.patch
+workqueue-make-sure-mayday_initial_timeout-is-at-least-2-jiffies-long.patch
diff --git a/queue-2.6.37/workqueue-make-sure-mayday_initial_timeout-is-at-least-2-jiffies-long.patch b/queue-2.6.37/workqueue-make-sure-mayday_initial_timeout-is-at-least-2-jiffies-long.patch
new file mode 100644 (file)
index 0000000..23b0fb3
--- /dev/null
@@ -0,0 +1,38 @@
+From 3233cdbd9fa347a6d6897a94cc6ed0302ae83c4f Mon Sep 17 00:00:00 2001
+From: Tejun Heo <tj@kernel.org>
+Date: Wed, 16 Feb 2011 18:10:19 +0100
+Subject: workqueue: make sure MAYDAY_INITIAL_TIMEOUT is at least 2 jiffies long
+
+From: Tejun Heo <tj@kernel.org>
+
+commit 3233cdbd9fa347a6d6897a94cc6ed0302ae83c4f upstream.
+
+MAYDAY_INITIAL_TIMEOUT is defined as HZ / 100 and depending on
+configuration may end up 0 or 1.  Even when it's 1, depending on when
+the mayday timer is added in the current jiffy interval, it may expire
+way before a jiffy has passed.
+
+Make sure MAYDAY_INITIAL_TIMEOUT is at least two to guarantee that at
+least a full jiffy has passed before calling rescuers.
+
+Signed-off-by: Tejun Heo <tj@kernel.org>
+Reported-by: Ray Jui <rjui@broadcom.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ kernel/workqueue.c |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/kernel/workqueue.c
++++ b/kernel/workqueue.c
+@@ -79,7 +79,9 @@ enum {
+       MAX_IDLE_WORKERS_RATIO  = 4,            /* 1/4 of busy can be idle */
+       IDLE_WORKER_TIMEOUT     = 300 * HZ,     /* keep idle ones for 5 mins */
+-      MAYDAY_INITIAL_TIMEOUT  = HZ / 100,     /* call for help after 10ms */
++      MAYDAY_INITIAL_TIMEOUT  = HZ / 100 >= 2 ? HZ / 100 : 2,
++                                              /* call for help after 10ms
++                                                 (min two ticks) */
+       MAYDAY_INTERVAL         = HZ / 10,      /* and then every 100ms */
+       CREATE_COOLDOWN         = HZ,           /* time to breath after fail */
+       TRUSTEE_COOLDOWN        = HZ / 10,      /* for trustee draining */
diff --git a/queue-2.6.37/workqueue-wake-up-a-worker-when-a-rescuer-is-leaving-a-gcwq.patch b/queue-2.6.37/workqueue-wake-up-a-worker-when-a-rescuer-is-leaving-a-gcwq.patch
new file mode 100644 (file)
index 0000000..795de29
--- /dev/null
@@ -0,0 +1,43 @@
+From 7576958a9d5a4a677ad7dd40901cdbb6c1110c98 Mon Sep 17 00:00:00 2001
+From: Tejun Heo <tj@kernel.org>
+Date: Mon, 14 Feb 2011 14:04:46 +0100
+Subject: workqueue: wake up a worker when a rescuer is leaving a gcwq
+
+From: Tejun Heo <tj@kernel.org>
+
+commit 7576958a9d5a4a677ad7dd40901cdbb6c1110c98 upstream.
+
+After executing the matching works, a rescuer leaves the gcwq whether
+there are more pending works or not.  This may decrease the
+concurrency level to zero and stall execution until a new work item is
+queued on the gcwq.
+
+Make rescuer wake up a regular worker when it leaves a gcwq if there
+are more works to execute, so that execution isn't stalled.
+
+Signed-off-by: Tejun Heo <tj@kernel.org>
+Reported-by: Ray Jui <rjui@broadcom.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ kernel/workqueue.c |    9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+--- a/kernel/workqueue.c
++++ b/kernel/workqueue.c
+@@ -2009,6 +2009,15 @@ repeat:
+                               move_linked_works(work, scheduled, &n);
+               process_scheduled_works(rescuer);
++
++              /*
++               * Leave this gcwq.  If keep_working() is %true, notify a
++               * regular worker; otherwise, we end up with 0 concurrency
++               * and stalling the execution.
++               */
++              if (keep_working(gcwq))
++                      wake_up_worker(gcwq);
++
+               spin_unlock_irq(&gcwq->lock);
+       }