mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-22 06:32:08 +00:00
kernel: workqueue: clarify wq_worker_last_func() caller requirements
This function can only be called safely from very specific scheduler contexts. Document those. Link: http://lkml.kernel.org/r/20190206150528.31198-1-hannes@cmpxchg.org Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> Suggested-by: Andrew Morton <akpm@linux-foundation.org> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
6eb3c3d0a5
commit
4b04700275
1 changed files with 10 additions and 0 deletions
|
@ -920,6 +920,16 @@ struct task_struct *wq_worker_sleeping(struct task_struct *task)
|
||||||
* CONTEXT:
|
* CONTEXT:
|
||||||
* spin_lock_irq(rq->lock)
|
* spin_lock_irq(rq->lock)
|
||||||
*
|
*
|
||||||
|
* This function is called during schedule() when a kworker is going
|
||||||
|
* to sleep. It's used by psi to identify aggregation workers during
|
||||||
|
* dequeuing, to allow periodic aggregation to shut-off when that
|
||||||
|
* worker is the last task in the system or cgroup to go to sleep.
|
||||||
|
*
|
||||||
|
* As this function doesn't involve any workqueue-related locking, it
|
||||||
|
* only returns stable values when called from inside the scheduler's
|
||||||
|
* queuing and dequeuing paths, when @task, which must be a kworker,
|
||||||
|
* is guaranteed to not be processing any works.
|
||||||
|
*
|
||||||
* Return:
|
* Return:
|
||||||
* The last work function %current executed as a worker, NULL if it
|
* The last work function %current executed as a worker, NULL if it
|
||||||
* hasn't executed any work yet.
|
* hasn't executed any work yet.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue