From 4f9c2cfa2437df673058dccf44c7b4116f40e611 Mon Sep 17 00:00:00 2001 From: Lai Jiangshan Date: Wed, 6 Feb 2013 18:04:53 -0800 Subject: [PATCH] --- yaml --- r: 350295 b: refs/heads/master c: 4468a00fd9a274fe1b30c886370d662e4a439efb h: refs/heads/master i: 350293: 8398f8218217d7d54976a011104ff51cbdd98ed7 350291: d851e311c26c5779f1fd344ef33972323c15d4ee 350287: 52287e798314c88f036bd17d08f1f8c8a7ae47d4 v: v3 --- [refs] | 2 +- trunk/kernel/workqueue.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 7bda4c52434e..77dc54980376 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 60c057bca22285efefbba033624763a778f243bf +refs/heads/master: 4468a00fd9a274fe1b30c886370d662e4a439efb diff --git a/trunk/kernel/workqueue.c b/trunk/kernel/workqueue.c index 41a502ce3802..1a442c301ddb 100644 --- a/trunk/kernel/workqueue.c +++ b/trunk/kernel/workqueue.c @@ -556,6 +556,13 @@ static void set_work_cwq(struct work_struct *work, WORK_STRUCT_PENDING | WORK_STRUCT_CWQ | extra_flags); } +static void set_work_pool_and_keep_pending(struct work_struct *work, + int pool_id) +{ + set_work_data(work, (unsigned long)pool_id << WORK_OFFQ_POOL_SHIFT, + WORK_STRUCT_PENDING); +} + static void set_work_pool_and_clear_pending(struct work_struct *work, int pool_id) { @@ -1115,6 +1122,9 @@ static int try_to_grab_pending(struct work_struct *work, bool is_dwork, 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); + spin_unlock(&pool->lock); return 1; }