Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 327194
b: refs/heads/master
c: 9f4bd4c
h: refs/heads/master
v: v3
  • Loading branch information
Lai Jiangshan authored and Tejun Heo committed Sep 19, 2012
1 parent c5eca92 commit d651e61
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b3f9f405a21a29c06c31fb2d6ab36ef9ba7c027b
refs/heads/master: 9f4bd4cddbb50d7617353102e10ce511c5ef6df2
26 changes: 21 additions & 5 deletions trunk/kernel/workqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -3366,6 +3366,26 @@ void destroy_workqueue(struct workqueue_struct *wq)
}
EXPORT_SYMBOL_GPL(destroy_workqueue);

/**
* cwq_set_max_active - adjust max_active of a cwq
* @cwq: target cpu_workqueue_struct
* @max_active: new max_active value.
*
* Set @cwq->max_active to @max_active and activate delayed works if
* increased.
*
* CONTEXT:
* spin_lock_irq(gcwq->lock).
*/
static void cwq_set_max_active(struct cpu_workqueue_struct *cwq, int max_active)
{
cwq->max_active = max_active;

while (!list_empty(&cwq->delayed_works) &&
cwq->nr_active < cwq->max_active)
cwq_activate_first_delayed(cwq);
}

/**
* workqueue_set_max_active - adjust max_active of a workqueue
* @wq: target workqueue
Expand Down Expand Up @@ -3792,11 +3812,7 @@ void thaw_workqueues(void)
continue;

/* restore max_active and repopulate worklist */
cwq->max_active = wq->saved_max_active;

while (!list_empty(&cwq->delayed_works) &&
cwq->nr_active < cwq->max_active)
cwq_activate_first_delayed(cwq);
cwq_set_max_active(cwq, wq->saved_max_active);
}

for_each_worker_pool(pool, gcwq)
Expand Down

0 comments on commit d651e61

Please sign in to comment.