This is a note to let you know that I've just added the patch titled sched/fair: Use __schedstat_set() in set_next_entity() to the 5.15-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: sched-fair-use-__schedstat_set-in-set_next_entity.patch and it can be found in the queue-5.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit db7e0e0bf775b2d483fdcea95eb9d6c545129b37 Author: Yafang Shao <laoar.shao@xxxxxxxxx> Date: Sun Sep 5 14:35:40 2021 +0000 sched/fair: Use __schedstat_set() in set_next_entity() [ Upstream commit a2dcb276ff9287fcea103ca1a2436383e8583751 ] schedstat_enabled() has been already checked, so we can use __schedstat_set() directly. Signed-off-by: Yafang Shao <laoar.shao@xxxxxxxxx> Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx> Acked-by: Mel Gorman <mgorman@xxxxxxx> Link: https://lore.kernel.org/r/20210905143547.4668-2-laoar.shao@xxxxxxxxx Stable-dep-of: 39afe5d6fc59 ("sched/fair: Fix inaccurate tally of ttwu_move_affine") Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 591fdc81378e0..70f7a3896a90c 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4691,9 +4691,9 @@ set_next_entity(struct cfs_rq *cfs_rq, struct sched_entity *se) */ if (schedstat_enabled() && rq_of(cfs_rq)->cfs.load.weight >= 2*se->load.weight) { - schedstat_set(se->statistics.slice_max, - max((u64)schedstat_val(se->statistics.slice_max), - se->sum_exec_runtime - se->prev_sum_exec_runtime)); + __schedstat_set(se->statistics.slice_max, + max((u64)se->statistics.slice_max, + se->sum_exec_runtime - se->prev_sum_exec_runtime)); } se->prev_sum_exec_runtime = se->sum_exec_runtime;