diff options
author | Tianchen Ding <[email protected]> | 2022-06-09 07:34:11 +0800 |
---|---|---|
committer | Peter Zijlstra <[email protected]> | 2022-06-13 10:30:01 +0200 |
commit | 28156108fecb1f808b21d216e8ea8f0d205a530c (patch) | |
tree | 00eeddc6d084d0059f632d9c7b7bebb4ace1839c /lib/mpi/mpi-mod.c | |
parent | 792b9f65a568f48c50b3175536db9cde5a1edcc0 (diff) |
sched: Fix the check of nr_running at queue wakelist
The commit 2ebb17717550 ("sched/core: Offload wakee task activation if it
the wakee is descheduling") checked rq->nr_running <= 1 to avoid task
stacking when WF_ON_CPU.
Per the ordering of writes to p->on_rq and p->on_cpu, observing p->on_cpu
(WF_ON_CPU) in ttwu_queue_cond() implies !p->on_rq, IOW p has gone through
the deactivate_task() in __schedule(), thus p has been accounted out of
rq->nr_running. As such, the task being the only runnable task on the rq
implies reading rq->nr_running == 0 at that point.
The benchmark result is in [1].
[1] https://lore.kernel.org/all/[email protected]/
Suggested-by: Valentin Schneider <[email protected]>
Signed-off-by: Tianchen Ding <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Reviewed-by: Valentin Schneider <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'lib/mpi/mpi-mod.c')
0 files changed, 0 insertions, 0 deletions