diff options
| author | Thomas Gleixner <tglx@linutronix.de> | 2014-02-21 21:36:40 +0100 |
|---|---|---|
| committer | Thomas Gleixner <tglx@linutronix.de> | 2014-02-21 21:37:09 +0100 |
| commit | d97a860c4f3de98ba5040a22f305b7159fe17cff (patch) | |
| tree | 90c2155ec5a1f3115a9eb7a86f25d1a4610227c6 /kernel/workqueue.c | |
| parent | 3f67d962c64d9b6de9dab81bdbe6d5c94c80d9b9 (diff) | |
| parent | d158fc7f36a25e19791d25a55da5623399a2644f (diff) | |
Merge branch 'linus' into sched/core
Reason: Bring bakc upstream modification to resolve conflicts
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/workqueue.c')
| -rw-r--r-- | kernel/workqueue.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 82ef9f3b747..193e977a10e 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -1851,6 +1851,12 @@ static void destroy_worker(struct worker *worker) if (worker->flags & WORKER_IDLE) pool->nr_idle--; + /* + * Once WORKER_DIE is set, the kworker may destroy itself at any + * point. Pin to ensure the task stays until we're done with it. + */ + get_task_struct(worker->task); + list_del_init(&worker->entry); worker->flags |= WORKER_DIE; @@ -1859,6 +1865,7 @@ static void destroy_worker(struct worker *worker) spin_unlock_irq(&pool->lock); kthread_stop(worker->task); + put_task_struct(worker->task); kfree(worker); spin_lock_irq(&pool->lock); |
