Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 350297
b: refs/heads/master
c: 1606283
h: refs/heads/master
i:
  350295: 4f9c2cf
v: v3
  • Loading branch information
Tejun Heo committed Feb 7, 2013
1 parent a64da2f commit fce44b8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 22 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: 0b3dae68ac199fac224fea9a31907b44f0d257b3
refs/heads/master: 1606283622689bdc460052b4a1281c36de13fe49
38 changes: 17 additions & 21 deletions trunk/kernel/workqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -1107,31 +1107,27 @@ static int try_to_grab_pending(struct work_struct *work, bool is_dwork,
* item is currently queued on that pool.
*/
cwq = get_work_cwq(work);
if (cwq) {
if (cwq->pool == pool) {
debug_work_deactivate(work);
if (cwq && cwq->pool == pool) {
debug_work_deactivate(work);

/*
* A delayed work item cannot be grabbed directly
* because it might have linked NO_COLOR work items
* which, if left on the delayed_list, will confuse
* cwq->nr_active management later on and cause
* stall. Make sure the work item is activated
* before grabbing.
*/
if (*work_data_bits(work) & WORK_STRUCT_DELAYED)
cwq_activate_delayed_work(work);
/*
* A delayed work item cannot be grabbed directly because
* it might have linked NO_COLOR work items which, if left
* on the delayed_list, will confuse cwq->nr_active
* management later on and cause stall. Make sure the work
* item is activated before grabbing.
*/
if (*work_data_bits(work) & WORK_STRUCT_DELAYED)
cwq_activate_delayed_work(work);

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

/* work->data points to cwq iff queued, point to pool */
set_work_pool_and_keep_pending(work, pool->id);
/* work->data points to cwq iff queued, point to pool */
set_work_pool_and_keep_pending(work, pool->id);

spin_unlock(&pool->lock);
return 1;
}
spin_unlock(&pool->lock);
return 1;
}
spin_unlock(&pool->lock);
fail:
Expand Down

0 comments on commit fce44b8

Please sign in to comment.