diff options
| author | Johannes Weiner <[email protected]> | 2024-10-11 08:49:33 +0000 |
|---|---|---|
| committer | Ingo Molnar <[email protected]> | 2024-10-14 07:11:42 +0000 |
| commit | c6508124193d42bbc3224571eb75bfa4c1821fbb (patch) | |
| tree | 5aec62d34d75c2943e20c7267b7adbbb0615cc10 /rust/helpers/helpers.c | |
| parent | sched/core: Dequeue PSI signals for blocked tasks that are delayed (diff) | |
| download | kernel-c6508124193d42bbc3224571eb75bfa4c1821fbb.tar.gz kernel-c6508124193d42bbc3224571eb75bfa4c1821fbb.zip | |
sched/psi: Fix mistaken CPU pressure indication after corrupted task state bug
Since sched_delayed tasks remain queued even after blocking, the load
balancer can migrate them between runqueues while PSI considers them
to be asleep. As a result, it misreads the migration requeue followed
by a wakeup as a double queue:
psi: inconsistent task state! task=... cpu=... psi_flags=4 clear=. set=4
First, call psi_enqueue() after p->sched_class->enqueue_task(). A
wakeup will clear p->se.sched_delayed while a migration will not, so
psi can use that flag to tell them apart.
Then teach psi to migrate any "sleep" state when delayed-dequeue tasks
are being migrated.
Delayed-dequeue tasks can be revived by ttwu_runnable(), which will
call down with a new ENQUEUE_DELAYED. Instead of further complicating
the wakeup conditional in enqueue_task(), identify migration contexts
instead and default to wakeup handling for all other cases.
It's not just the warning in dmesg, the task state corruption causes a
permanent CPU pressure indication, which messes with workload/machine
health monitoring.
Debugged-by-and-original-fix-by: K Prateek Nayak <[email protected]>
Fixes: 152e11f6df29 ("sched/fair: Implement delayed dequeue")
Closes: https://lore.kernel.org/lkml/[email protected]/
Closes: https://lore.kernel.org/all/[email protected]/
Signed-off-by: Johannes Weiner <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Tested-by: K Prateek Nayak <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
Diffstat (limited to 'rust/helpers/helpers.c')
0 files changed, 0 insertions, 0 deletions
