]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
sched/fair: Fold the sched_avg update
authorPeter Zijlstra <peterz@infradead.org>
Thu, 27 Nov 2025 15:39:44 +0000 (16:39 +0100)
committerIngo Molnar <mingo@kernel.org>
Sun, 14 Dec 2025 07:25:02 +0000 (08:25 +0100)
commit089d84203ad42bc8fd6dbf41683e162ac6e848cd
tree98500799d8d29a98bc3ec5901b3006688dfc1b1d
parent38a68b982dd0b10e3da943f100e034598326eafe
sched/fair: Fold the sched_avg update

Nine (and a half) instances of the same pattern is just silly, fold the lot.

Notably, the half instance in enqueue_load_avg() is right after setting
cfs_rq->avg.load_sum to cfs_rq->avg.load_avg * get_pelt_divider(&cfs_rq->avg).
Since get_pelt_divisor() >= PELT_MIN_DIVIDER, this ends up being a no-op
change.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Shrikanth Hegde <sshegde@linux.ibm.com>
Cc: Valentin Schneider <vschneid@redhat.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Link: https://patch.msgid.link/20251127154725.413564507@infradead.org
kernel/sched/fair.c