Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

sched/fair: Fix sched_avg fold

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

Fixes: 089d84203ad4 ("sched/fair: Fold the sched_avg update")
Reported-by: kernel test robot <oliver.sang@intel.com>
Closes: https://lore.kernel.org/oe-lkp/202512181208.753b9f6e-lkp@intel.com
Debugged-by: Shrikanth Hegde <sshegde@linux.ibm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20251218102020.GO3707891@noisy.programming.kicks-ass.net

+4 -2
+4 -2
kernel/sched/fair.c
··· 3775 3775 static inline void 3776 3776 enqueue_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *se) 3777 3777 { 3778 - __update_sa(&cfs_rq->avg, load, se->avg.load_avg, se->avg.load_sum); 3778 + __update_sa(&cfs_rq->avg, load, se->avg.load_avg, 3779 + se_weight(se) * se->avg.load_sum); 3779 3780 } 3780 3781 3781 3782 static inline void 3782 3783 dequeue_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *se) 3783 3784 { 3784 - __update_sa(&cfs_rq->avg, load, -se->avg.load_avg, -se->avg.load_sum); 3785 + __update_sa(&cfs_rq->avg, load, -se->avg.load_avg, 3786 + se_weight(se) * -se->avg.load_sum); 3785 3787 } 3786 3788 3787 3789 static void place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags);