diff options
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r-- | kernel/workqueue.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 41a502ce3802..1a442c301ddb 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
@@ -556,6 +556,13 @@ static void set_work_cwq(struct work_struct *work, | |||
556 | WORK_STRUCT_PENDING | WORK_STRUCT_CWQ | extra_flags); | 556 | WORK_STRUCT_PENDING | WORK_STRUCT_CWQ | extra_flags); |
557 | } | 557 | } |
558 | 558 | ||
559 | static void set_work_pool_and_keep_pending(struct work_struct *work, | ||
560 | int pool_id) | ||
561 | { | ||
562 | set_work_data(work, (unsigned long)pool_id << WORK_OFFQ_POOL_SHIFT, | ||
563 | WORK_STRUCT_PENDING); | ||
564 | } | ||
565 | |||
559 | static void set_work_pool_and_clear_pending(struct work_struct *work, | 566 | static void set_work_pool_and_clear_pending(struct work_struct *work, |
560 | int pool_id) | 567 | int pool_id) |
561 | { | 568 | { |
@@ -1115,6 +1122,9 @@ static int try_to_grab_pending(struct work_struct *work, bool is_dwork, | |||
1115 | cwq_dec_nr_in_flight(get_work_cwq(work), | 1122 | cwq_dec_nr_in_flight(get_work_cwq(work), |
1116 | get_work_color(work)); | 1123 | get_work_color(work)); |
1117 | 1124 | ||
1125 | /* work->data points to cwq iff queued, point to pool */ | ||
1126 | set_work_pool_and_keep_pending(work, pool->id); | ||
1127 | |||
1118 | spin_unlock(&pool->lock); | 1128 | spin_unlock(&pool->lock); |
1119 | return 1; | 1129 | return 1; |
1120 | } | 1130 | } |