Commit f5aaff7
Peter Zijlstra
sched/core: Dequeue PSI signals for blocked tasks that are delayed
psi_dequeue() in for blocked task expects psi_sched_switch() to clear
the TSK_.*RUNNING PSI flags and set the TSK_IOWAIT flags however
psi_sched_switch() uses "!task_on_rq_queued(prev)" to detect if the task
is blocked or still runnable which is no longer true with DELAY_DEQUEUE
since a blocking task can be left queued on the runqueue.
This can lead to PSI splats similar to:
psi: inconsistent task state! task=... cpu=... psi_flags=4 clear=0 set=4
when the task is requeued since the TSK_RUNNING flag was not cleared
when the task was blocked.
Explicitly communicate that the task was blocked to psi_sched_switch()
even if it was delayed and is still on the runqueue.
[ prateek: Broke off the relevant part from [1], commit message ]
Fixes: 152e11f ("sched/fair: Implement delayed dequeue")
Closes: https://lore.kernel.org/lkml/[email protected]/
Closes: https://lore.kernel.org/all/[email protected]/
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Not-yet-signed-off-by: Peter Zijlstra <[email protected]>
Signed-off-by: K Prateek Nayak <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Tested-by: Johannes Weiner <[email protected]>
Link: https://lore.kernel.org/lkml/[email protected]/ [1]1 parent 98442f0 commit f5aaff7
1 file changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6537 | 6537 | | |
6538 | 6538 | | |
6539 | 6539 | | |
| 6540 | + | |
6540 | 6541 | | |
6541 | 6542 | | |
6542 | 6543 | | |
| |||
6622 | 6623 | | |
6623 | 6624 | | |
6624 | 6625 | | |
| 6626 | + | |
6625 | 6627 | | |
6626 | 6628 | | |
6627 | 6629 | | |
| |||
6667 | 6669 | | |
6668 | 6670 | | |
6669 | 6671 | | |
6670 | | - | |
| 6672 | + | |
6671 | 6673 | | |
6672 | 6674 | | |
6673 | 6675 | | |
| |||
0 commit comments