diff options
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/workqueue.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index d2fe8e77ceb7..3e324aae3c98 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
| @@ -999,7 +999,6 @@ static void cwq_activate_first_delayed(struct cpu_workqueue_struct *cwq) | |||
| 999 | * cwq_dec_nr_in_flight - decrement cwq's nr_in_flight | 999 | * cwq_dec_nr_in_flight - decrement cwq's nr_in_flight |
| 1000 | * @cwq: cwq of interest | 1000 | * @cwq: cwq of interest |
| 1001 | * @color: color of work which left the queue | 1001 | * @color: color of work which left the queue |
| 1002 | * @delayed: for a delayed work | ||
| 1003 | * | 1002 | * |
| 1004 | * A work either has completed or is removed from pending queue, | 1003 | * A work either has completed or is removed from pending queue, |
| 1005 | * decrement nr_in_flight of its cwq and handle workqueue flushing. | 1004 | * decrement nr_in_flight of its cwq and handle workqueue flushing. |
| @@ -1007,8 +1006,7 @@ static void cwq_activate_first_delayed(struct cpu_workqueue_struct *cwq) | |||
| 1007 | * CONTEXT: | 1006 | * CONTEXT: |
| 1008 | * spin_lock_irq(gcwq->lock). | 1007 | * spin_lock_irq(gcwq->lock). |
| 1009 | */ | 1008 | */ |
| 1010 | static void cwq_dec_nr_in_flight(struct cpu_workqueue_struct *cwq, int color, | 1009 | static void cwq_dec_nr_in_flight(struct cpu_workqueue_struct *cwq, int color) |
| 1011 | bool delayed) | ||
| 1012 | { | 1010 | { |
| 1013 | /* ignore uncolored works */ | 1011 | /* ignore uncolored works */ |
| 1014 | if (color == WORK_NO_COLOR) | 1012 | if (color == WORK_NO_COLOR) |
| @@ -1016,13 +1014,11 @@ static void cwq_dec_nr_in_flight(struct cpu_workqueue_struct *cwq, int color, | |||
| 1016 | 1014 | ||
| 1017 | cwq->nr_in_flight[color]--; | 1015 | cwq->nr_in_flight[color]--; |
| 1018 | 1016 | ||
| 1019 | if (!delayed) { | 1017 | cwq->nr_active--; |
| 1020 | cwq->nr_active--; | 1018 | if (!list_empty(&cwq->delayed_works)) { |
| 1021 | if (!list_empty(&cwq->delayed_works)) { | 1019 | /* one down, submit a delayed one */ |
| 1022 | /* one down, submit a delayed one */ | 1020 | if (cwq->nr_active < cwq->max_active) |
| 1023 | if (cwq->nr_active < cwq->max_active) | 1021 | cwq_activate_first_delayed(cwq); |
| 1024 | cwq_activate_first_delayed(cwq); | ||
| 1025 | } | ||
| 1026 | } | 1022 | } |
| 1027 | 1023 | ||
| 1028 | /* is flush in progress and are we at the flushing tip? */ | 1024 | /* is flush in progress and are we at the flushing tip? */ |
| @@ -1127,8 +1123,7 @@ static int try_to_grab_pending(struct work_struct *work, bool is_dwork, | |||
| 1127 | 1123 | ||
| 1128 | list_del_init(&work->entry); | 1124 | list_del_init(&work->entry); |
| 1129 | cwq_dec_nr_in_flight(get_work_cwq(work), | 1125 | cwq_dec_nr_in_flight(get_work_cwq(work), |
| 1130 | get_work_color(work), | 1126 | get_work_color(work)); |
| 1131 | *work_data_bits(work) & WORK_STRUCT_DELAYED); | ||
| 1132 | 1127 | ||
| 1133 | spin_unlock(&gcwq->lock); | 1128 | spin_unlock(&gcwq->lock); |
| 1134 | return 1; | 1129 | return 1; |
| @@ -2264,7 +2259,7 @@ __acquires(&gcwq->lock) | |||
| 2264 | hlist_del_init(&worker->hentry); | 2259 | hlist_del_init(&worker->hentry); |
| 2265 | worker->current_work = NULL; | 2260 | worker->current_work = NULL; |
| 2266 | worker->current_cwq = NULL; | 2261 | worker->current_cwq = NULL; |
| 2267 | cwq_dec_nr_in_flight(cwq, work_color, false); | 2262 | cwq_dec_nr_in_flight(cwq, work_color); |
| 2268 | } | 2263 | } |
| 2269 | 2264 | ||
| 2270 | /** | 2265 | /** |
