History

Merge branch 'master' into for-2.6.39

Tejun Heo committed 15 years ago

Commit 43d133c2 parents 4149efb 6f576d51051 files · +13734 −8120Browse files

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

Unified · Split

kernel/workqueue.c+24−13
@@ -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 */
@@ -2049,6 +2051,15 @@ repeat: · 1963 unmodified lines
20492051 move_linked_works(work, scheduled, &n);
20502052
20512053 process_scheduled_works(rescuer);
2054+
2055+ /*
2056+ * Leave this gcwq. If keep_working() is %true, notify a
2057+ * regular worker; otherwise, we end up with 0 concurrency
2058+ * and stalling the execution.
2059+ */
2060+ if (keep_working(gcwq))
2061+ wake_up_worker(gcwq);
2062+
20522063 spin_unlock_irq(&gcwq->lock);
20532064 }
20542065
@@ -2958,7 +2969,7 @@ struct workqueue_struct *__alloc_workqueue_key(const char *name, · 903 unmodified lines
29582969 */
29592970 spin_lock(&workqueue_lock);
29602971
2961− if (workqueue_freezing && wq->flags & WQ_FREEZEABLE)
2972+ if (workqueue_freezing && wq->flags & WQ_FREEZABLE)
29622973 for_each_cwq_cpu(cpu, wq)
29632974 get_cwq(cpu, wq)->max_active = 0;
29642975
@@ -3070,7 +3081,7 @@ void workqueue_set_max_active(struct workqueue_struct *wq, int max_active) · 105 unmodified lines
30703081
30713082 spin_lock_irq(&gcwq->lock);
30723083
3073− if (!(wq->flags & WQ_FREEZEABLE) ||
3084+ if (!(wq->flags & WQ_FREEZABLE) ||
30743085 !(gcwq->flags & GCWQ_FREEZING))
30753086 get_cwq(gcwq->cpu, wq)->max_active = max_active;
30763087
@@ -3320,7 +3331,7 @@ static int __cpuinit trustee_thread(void *__gcwq) · 243 unmodified lines
33203331 * want to get it over with ASAP - spam rescuers, wake up as
33213332 * many idlers as necessary and create new ones till the
33223333 * worklist is empty. Note that if the gcwq is frozen, there
3323− * may be frozen works in freezeable cwqs. Don't declare
3334+ * may be frozen works in freezable cwqs. Don't declare
33243335 * completion while frozen.
33253336 */
33263337 while (gcwq->nr_workers != gcwq->nr_idle ||
@@ -3578,9 +3589,9 @@ EXPORT_SYMBOL_GPL(work_on_cpu); · 251 unmodified lines
35783589 /**
35793590 * freeze_workqueues_begin - begin freezing workqueues
35803591 *
3581− * Start freezing workqueues. After this function returns, all
3582− * freezeable workqueues will queue new works to their frozen_works
3583− * list instead of gcwq->worklist.
3592+ * Start freezing workqueues. After this function returns, all freezable
3593+ * workqueues will queue new works to their frozen_works list instead of
3594+ * gcwq->worklist.
35843595 *
35853596 * CONTEXT:
35863597 * Grabs and releases workqueue_lock and gcwq->lock's.
@@ -3606,7 +3617,7 @@ void freeze_workqueues_begin(void) · 19 unmodified lines
36063617 list_for_each_entry(wq, &workqueues, list) {
36073618 struct cpu_workqueue_struct *cwq = get_cwq(cpu, wq);
36083619
3609− if (cwq && wq->flags & WQ_FREEZEABLE)
3620+ if (cwq && wq->flags & WQ_FREEZABLE)
36103621 cwq->max_active = 0;
36113622 }
36123623
@@ -3617,7 +3628,7 @@ void freeze_workqueues_begin(void) · 4 unmodified lines
36173628 }
36183629
36193630 /**
3620− * freeze_workqueues_busy - are freezeable workqueues still busy?
3631+ * freeze_workqueues_busy - are freezable workqueues still busy?
36213632 *
36223633 * Check whether freezing is complete. This function must be called
36233634 * between freeze_workqueues_begin() and thaw_workqueues().
@@ -3626,8 +3637,8 @@ void freeze_workqueues_begin(void) · 2 unmodified lines
36263637 * Grabs and releases workqueue_lock.
36273638 *
36283639 * RETURNS:
3629− * %true if some freezeable workqueues are still busy. %false if
3630− * freezing is complete.
3640+ * %true if some freezable workqueues are still busy. %false if freezing
3641+ * is complete.
36313642 */
36323643 bool freeze_workqueues_busy(void)
36333644 {
@@ -3647,7 +3658,7 @@ bool freeze_workqueues_busy(void) · 13 unmodified lines
36473658 list_for_each_entry(wq, &workqueues, list) {
36483659 struct cpu_workqueue_struct *cwq = get_cwq(cpu, wq);
36493660
3650− if (!cwq || !(wq->flags & WQ_FREEZEABLE))
3661+ if (!cwq || !(wq->flags & WQ_FREEZABLE))
36513662 continue;
36523663
36533664 BUG_ON(cwq->nr_active < 0);
@@ -3692,7 +3703,7 @@ void thaw_workqueues(void) · 38 unmodified lines
36923703 list_for_each_entry(wq, &workqueues, list) {
36933704 struct cpu_workqueue_struct *cwq = get_cwq(cpu, wq);
36943705
3695− if (!cwq || !(wq->flags & WQ_FREEZEABLE))
3706+ if (!cwq || !(wq->flags & WQ_FREEZABLE))
36963707 continue;
36973708
36983709 /* restore max_active and repopulate worklist */