History

workqueue: make sure MAYDAY_INITIAL_TIMEOUT is at least 2 jiffies long

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.

Tejun Heo committed 15 years ago

Commit 3233cdb1 parent 58a69cb1 file · +3 −1Browse files

Showing the changes to kernel/workqueue.c (1 of 1 file). Show all

Unified · Split

kernel/workqueue.c+3−1
@@ -79,7 +79,9 @@ enum { · 78 unmodified lines
7979 MAX_IDLE_WORKERS_RATIO = 4, /* 1/4 of busy can be idle */
8080 IDLE_WORKER_TIMEOUT = 300 * HZ, /* keep idle ones for 5 mins */
8181
82− MAYDAY_INITIAL_TIMEOUT = HZ / 100, /* call for help after 10ms */
82+ MAYDAY_INITIAL_TIMEOUT = HZ / 100 >= 2 ? HZ / 100 : 2,
83+ /* call for help after 10ms
84+ (min two ticks) */
8385 MAYDAY_INTERVAL = HZ / 10, /* and then every 100ms */
8486 CREATE_COOLDOWN = HZ, /* time to breath after fail */
8587 TRUSTEE_COOLDOWN = HZ / 10, /* for trustee draining */