]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Mar 2025 11:49:52 +0000 (12:49 +0100)
commitb3a5ff8c4b6e5bcc25f43c6eee9f07a9eac0d866
tree06fceac28e1a5ecaf237b22046b1f23dd35a0433
parent105ff30243975cedaec0195f8c9f1d0dfde0d80f
sched/psi: Use task->psi_flags to clear in CPU migration

[ Upstream commit 52b33d87b9197c51e8ffdc61873739d90dd0a16f ]

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
Stable-dep-of: a430d99e3490 ("sched/fair: Fix value reported by hot tasks pulled in /proc/schedstat")
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/linux/sched.h
kernel/sched/core.c
kernel/sched/stats.h