Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 327193
b: refs/heads/master
c: b3f9f40
h: refs/heads/master
i:
  327191: c937ad2
v: v3
  • Loading branch information
Lai Jiangshan authored and Tejun Heo committed Sep 18, 2012
1 parent 4244a59 commit c5eca92
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 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: 3aa62497594430ea522050b75c033f71f2c60ee6
refs/heads/master: b3f9f405a21a29c06c31fb2d6ab36ef9ba7c027b
21 changes: 8 additions & 13 deletions trunk/kernel/workqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -999,30 +999,26 @@ static void cwq_activate_first_delayed(struct cpu_workqueue_struct *cwq)
* cwq_dec_nr_in_flight - decrement cwq's nr_in_flight
* @cwq: cwq of interest
* @color: color of work which left the queue
* @delayed: for a delayed work
*
* A work either has completed or is removed from pending queue,
* decrement nr_in_flight of its cwq and handle workqueue flushing.
*
* CONTEXT:
* spin_lock_irq(gcwq->lock).
*/
static void cwq_dec_nr_in_flight(struct cpu_workqueue_struct *cwq, int color,
bool delayed)
static void cwq_dec_nr_in_flight(struct cpu_workqueue_struct *cwq, int color)
{
/* ignore uncolored works */
if (color == WORK_NO_COLOR)
return;

cwq->nr_in_flight[color]--;

if (!delayed) {
cwq->nr_active--;
if (!list_empty(&cwq->delayed_works)) {
/* one down, submit a delayed one */
if (cwq->nr_active < cwq->max_active)
cwq_activate_first_delayed(cwq);
}
cwq->nr_active--;
if (!list_empty(&cwq->delayed_works)) {
/* one down, submit a delayed one */
if (cwq->nr_active < cwq->max_active)
cwq_activate_first_delayed(cwq);
}

/* is flush in progress and are we at the flushing tip? */
Expand Down Expand Up @@ -1127,8 +1123,7 @@ static int try_to_grab_pending(struct work_struct *work, bool is_dwork,

list_del_init(&work->entry);
cwq_dec_nr_in_flight(get_work_cwq(work),
get_work_color(work),
*work_data_bits(work) & WORK_STRUCT_DELAYED);
get_work_color(work));

spin_unlock(&gcwq->lock);
return 1;
Expand Down Expand Up @@ -2264,7 +2259,7 @@ __acquires(&gcwq->lock)
hlist_del_init(&worker->hentry);
worker->current_work = NULL;
worker->current_cwq = NULL;
cwq_dec_nr_in_flight(cwq, work_color, false);
cwq_dec_nr_in_flight(cwq, work_color);
}

/**
Expand Down

0 comments on commit c5eca92

Please sign in to comment.