sched/psi: Use task->psi_flags to clear in CPU migration
authorChengming Zhou <zhouchengming@bytedance.com>
Mon, 26 Sep 2022 08:19:31 +0000 (16:19 +0800)
committerPeter Zijlstra <peterz@infradead.org>
Sun, 30 Oct 2022 09:12:15 +0000 (10:12 +0100)
commit52b33d87b9197c51e8ffdc61873739d90dd0a16f
tree392b655b87d75cce109258c3adc5f8157dea366b
parent710ffe671e014d5ccbcff225130a178b088ef090
sched/psi: Use task->psi_flags to clear in CPU migration

The commit d583d360a620 ("psi: Fix psi state corruption when schedule()
races with cgroup move") fixed a race problem by making cgroup_move_task()
use task->psi_flags instead of looking at the scheduler state.

We can extend task->psi_flags usage to CPU migration, which should be
a minor optimization for performance and code simplicity.

Signed-off-by: Chengming Zhou <zhouchengming@bytedance.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Link: https://lore.kernel.org/r/20220926081931.45420-1-zhouchengming@bytedance.com
include/linux/sched.h
kernel/sched/core.c
kernel/sched/stats.h