From: Greg Kroah-Hartman Date: Fri, 18 Feb 2011 21:33:46 +0000 (-0800) Subject: .37 patches X-Git-Tag: v2.6.37.2~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=472f459b32f7274e8d1d2e26f9eba3817631f53f;p=thirdparty%2Fkernel%2Fstable-queue.git .37 patches --- diff --git a/queue-2.6.37/series b/queue-2.6.37/series index b00e8083465..a88b4ea5a5d 100644 --- a/queue-2.6.37/series +++ b/queue-2.6.37/series @@ -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 index 00000000000..23b0fb3886f --- /dev/null +++ b/queue-2.6.37/workqueue-make-sure-mayday_initial_timeout-is-at-least-2-jiffies-long.patch @@ -0,0 +1,38 @@ +From 3233cdbd9fa347a6d6897a94cc6ed0302ae83c4f Mon Sep 17 00:00:00 2001 +From: Tejun Heo +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 + +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 +Reported-by: Ray Jui +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..795de2910a9 --- /dev/null +++ b/queue-2.6.37/workqueue-wake-up-a-worker-when-a-rescuer-is-leaving-a-gcwq.patch @@ -0,0 +1,43 @@ +From 7576958a9d5a4a677ad7dd40901cdbb6c1110c98 Mon Sep 17 00:00:00 2001 +From: Tejun Heo +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 + +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 +Reported-by: Ray Jui +Signed-off-by: Greg Kroah-Hartman + +--- + 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); + } +