diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2019-02-14 22:26:50 +0100 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2019-02-14 22:26:50 +0100 |
commit | d869f86645fc07dc83b89b68f1a22d91ebe29439 (patch) | |
tree | a3c2c1167bb34c8d0367d77e1a5734fc842d9f30 /kernel/workqueue.c | |
parent | 030fc443aef663df71cd834331fd8f1ec10c30c0 (diff) | |
parent | 74e96711e3379fc66630f2a1d184947f80cf2c48 (diff) |
Merge branch 'linus' into irq/core
Pick up upstream changes to avoid conflicts for pending patches.
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r-- | kernel/workqueue.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 392be4b252f6..fc5d23d752a5 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -910,6 +910,26 @@ struct task_struct *wq_worker_sleeping(struct task_struct *task) } /** + * wq_worker_last_func - retrieve worker's last work function + * + * Determine the last function a worker executed. This is called from + * the scheduler to get a worker's last known identity. + * + * CONTEXT: + * spin_lock_irq(rq->lock) + * + * Return: + * The last work function %current executed as a worker, NULL if it + * hasn't executed any work yet. + */ +work_func_t wq_worker_last_func(struct task_struct *task) +{ + struct worker *worker = kthread_data(task); + + return worker->last_func; +} + +/** * worker_set_flags - set worker flags and adjust nr_running accordingly * @worker: self * @flags: flags to set @@ -2184,6 +2204,9 @@ __acquires(&pool->lock) if (unlikely(cpu_intensive)) worker_clr_flags(worker, WORKER_CPU_INTENSIVE); + /* tag the worker for identification in schedule() */ + worker->last_func = worker->current_func; + /* we're done with it, release */ hash_del(&worker->hentry); worker->current_work = NULL; |