aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/workqueue.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r--kernel/workqueue.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 6b9b0dc3dea5..0c329a6f0c51 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -159,6 +159,7 @@ struct worker_pool {
159 159
160 /* see manage_workers() for details on the two manager mutexes */ 160 /* see manage_workers() for details on the two manager mutexes */
161 struct mutex manager_arb; /* manager arbitration */ 161 struct mutex manager_arb; /* manager arbitration */
162 struct worker *manager; /* L: purely informational */
162 struct mutex attach_mutex; /* attach/detach exclusion */ 163 struct mutex attach_mutex; /* attach/detach exclusion */
163 struct list_head workers; /* A: attached workers */ 164 struct list_head workers; /* A: attached workers */
164 struct completion *detach_completion; /* all workers detached */ 165 struct completion *detach_completion; /* all workers detached */
@@ -1918,9 +1919,11 @@ static bool manage_workers(struct worker *worker)
1918 */ 1919 */
1919 if (!mutex_trylock(&pool->manager_arb)) 1920 if (!mutex_trylock(&pool->manager_arb))
1920 return false; 1921 return false;
1922 pool->manager = worker;
1921 1923
1922 maybe_create_worker(pool); 1924 maybe_create_worker(pool);
1923 1925
1926 pool->manager = NULL;
1924 mutex_unlock(&pool->manager_arb); 1927 mutex_unlock(&pool->manager_arb);
1925 return true; 1928 return true;
1926} 1929}
@@ -2310,6 +2313,7 @@ repeat:
2310struct wq_barrier { 2313struct wq_barrier {
2311 struct work_struct work; 2314 struct work_struct work;
2312 struct completion done; 2315 struct completion done;
2316 struct task_struct *task; /* purely informational */
2313}; 2317};
2314 2318
2315static void wq_barrier_func(struct work_struct *work) 2319static void wq_barrier_func(struct work_struct *work)
@@ -2358,6 +2362,7 @@ static void insert_wq_barrier(struct pool_workqueue *pwq,
2358 INIT_WORK_ONSTACK(&barr->work, wq_barrier_func); 2362 INIT_WORK_ONSTACK(&barr->work, wq_barrier_func);
2359 __set_bit(WORK_STRUCT_PENDING_BIT, work_data_bits(&barr->work)); 2363 __set_bit(WORK_STRUCT_PENDING_BIT, work_data_bits(&barr->work));
2360 init_completion(&barr->done); 2364 init_completion(&barr->done);
2365 barr->task = current;
2361 2366
2362 /* 2367 /*
2363 * If @target is currently being executed, schedule the 2368 * If @target is currently being executed, schedule the