Commit 6ab7973f authored by Peter Zijlstra's avatar Peter Zijlstra
Browse files

sched/fair: Fix sched_avg fold



After the robot reported a regression wrt commit: 089d8420 ("sched/fair:
Fold the sched_avg update"), Shrikanth noted that two spots missed a factor
se_weight().

Fixes: 089d8420 ("sched/fair: Fold the sched_avg update")
Reported-by: default avatarkernel test robot <oliver.sang@intel.com>
Closes: https://lore.kernel.org/oe-lkp/202512181208.753b9f6e-lkp@intel.com


Debugged-by: default avatarShrikanth Hegde <sshegde@linux.ibm.com>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20251218102020.GO3707891@noisy.programming.kicks-ass.net
parent 1862d8e2
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -3775,13 +3775,15 @@ account_entity_dequeue(struct cfs_rq *cfs_rq, struct sched_entity *se)
static inline void
enqueue_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *se)
{
	__update_sa(&cfs_rq->avg, load, se->avg.load_avg, se->avg.load_sum);
	__update_sa(&cfs_rq->avg, load, se->avg.load_avg,
		    se_weight(se) * se->avg.load_sum);
}

static inline void
dequeue_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *se)
{
	__update_sa(&cfs_rq->avg, load, -se->avg.load_avg, -se->avg.load_sum);
	__update_sa(&cfs_rq->avg, load, -se->avg.load_avg,
		    se_weight(se) * -se->avg.load_sum);
}

static void place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags);