This is a note to let you know that I've just added the patch titled

    workqueue: make sure MAYDAY_INITIAL_TIMEOUT is at least 2 jiffies long

to the 2.6.37-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     workqueue-make-sure-mayday_initial_timeout-is-at-least-2-jiffies-long.patch
and it can be found in the queue-2.6.37 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From 3233cdbd9fa347a6d6897a94cc6ed0302ae83c4f Mon Sep 17 00:00:00 2001
From: Tejun Heo <[email protected]>
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 <[email protected]>

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 <[email protected]>
Reported-by: Ray Jui <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 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 */


Patches currently in stable-queue which might be from [email protected] are

queue-2.6.37/workqueue-wake-up-a-worker-when-a-rescuer-is-leaving-a-gcwq.patch
queue-2.6.37/workqueue-make-sure-mayday_initial_timeout-is-at-least-2-jiffies-long.patch

_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable

Reply via email to