History

workqueue: reuse the already calculated pwq in try_to_grab_pending()

try_to_grab_pending() was re-calculating the associated pwq using get_work_pwq() when it already has it cached in a local varible and the association can't change. Reuse the local variable instead. This doesn't introduce any functional changes. tj: Updated description.

Lai Jiangshan committed 12 years ago

Commit 9c34a701 parent 85327af1 file · +1 −1Browse files

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

Unified · Split

kernel/workqueue.c+1−1
@@ -1225,7 +1225,7 @@ static int try_to_grab_pending(struct work_struct *work, bool is_dwork, · 1224 unmodified lines
1225 pwq_activate_delayed_work(work);1225 pwq_activate_delayed_work(work);
1226 1226
1227 list_del_init(&work->entry);1227 list_del_init(&work->entry);
1228 pwq_dec_nr_in_flight(get_work_pwq(work), get_work_color(work));1228 pwq_dec_nr_in_flight(pwq, get_work_color(work));
1229 1229
1230 /* work->data points to pwq iff queued, point to pool */1230 /* work->data points to pwq iff queued, point to pool */
1231 set_work_pool_and_keep_pending(work, pool->id);1231 set_work_pool_and_keep_pending(work, pool->id);