v6.12 backport for psi: Fix race when task wakes up before psi_sched_switch() adjusts flags

Paul Kramme
2025-02-04T15:31:57Z

Hello,

we are seeing broken CPU PSI metrics across our infrastructure running
6.12, with messages like "psi: inconsistent task state!
task=1831:hackbench cpu=8 psi_flags=14 clear=0 set=4" in dmesg. I
believe commit 7d9da040575b343085287686fa902a5b2d43c7ca might fix this
issue.

psi: Fix race when task wakes up before psi_sched_switch() adjusts flags

Thanks

Paul