[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250825095056.GA87@bytedance>
Date: Mon, 25 Aug 2025 17:50:56 +0800
From: Aaron Lu <ziqianlu@...edance.com>
To: xupengbo <xupengbo@...o.com>
Cc: bsegall@...gle.com, cgroups@...r.kernel.org, dietmar.eggemann@....com,
juri.lelli@...hat.com, linux-kernel@...r.kernel.org,
mgorman@...e.de, mingo@...hat.com, peterz@...radead.org,
rostedt@...dmis.org, vincent.guittot@...aro.org,
vschneid@...hat.com
Subject: Re: [PATCH v2] sched/fair: Fix unfairness caused by stalled
tg_load_avg_contrib when the last task migrates out.
Hi xupengbo,
On Wed, Aug 06, 2025 at 04:38:10PM +0800, xupengbo wrote:
... ...
>
> It actually becomes:
> if (cfs_rq->tg_load_avg_contrib > 0)
> if cfs_rq->tg_load_avg_contrib == 0 , it will be false. As it is an unsigned
> long, this condition is equivalent to :
> if (cfs_rq->tg_load_avg_contrib)
I suppose we have reached a conclusion that the right fix is to add a
check of cfs_rq->tg_load_avg_contrib in cfs_rq_is_decayed()? Something
like below:
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index af33d107d8034..3ebcb683063f0 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4056,6 +4056,9 @@ static inline bool cfs_rq_is_decayed(struct cfs_rq *cfs_rq)
if (child_cfs_rq_on_list(cfs_rq))
return false;
+ if (cfs_rq->tg_load_avg_contrib)
+ return false;
+
return true;
}
If you also agree, can you send an updated patch to fix this problem?
Thanks.
Powered by blists - more mailing lists