From: Aaron Lu <ziqianlu@bytedance.com>
To: xupengbo <xupengbo@oppo.com>
Cc: bsegall@google.com, cgroups@vger.kernel.org,
dietmar.eggemann@arm.com, juri.lelli@redhat.com,
linux-kernel@vger.kernel.org, mgorman@suse.de, mingo@redhat.com,
peterz@infradead.org, rostedt@goodmis.org,
vincent.guittot@linaro.org, vschneid@redhat.com
Subject: Re: [PATCH v2] sched/fair: Fix unfairness caused by stalled tg_load_avg_contrib when the last task migrates out.
Date: Mon, 25 Aug 2025 17:50:56 +0800 [thread overview]
Message-ID: <20250825095056.GA87@bytedance> (raw)
In-Reply-To: <20250806083810.27678-1-xupengbo@oppo.com>
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.
next prev parent reply other threads:[~2025-08-25 9:51 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-04 13:03 [PATCH] sched/fair: Fix unfairness caused by stalled tg_load_avg_contrib when the last task migrates out xupengbo
2025-08-05 9:08 ` Aaron Lu
2025-08-05 9:17 ` Vincent Guittot
2025-08-06 6:31 ` [PATCH v2] " xupengbo
2025-08-06 7:33 ` Aaron Lu
2025-08-06 7:58 ` xupengbo
2025-08-06 8:38 ` xupengbo
2025-08-06 9:22 ` Vincent Guittot
2025-08-25 9:50 ` Aaron Lu [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-08-05 14:41 xupengbo
2025-08-05 16:10 ` Vincent Guittot
2025-08-26 7:57 [PATCH v3] " xupengbo
2025-08-26 8:17 ` [PATCH v2] " xupengbo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250825095056.GA87@bytedance \
--to=ziqianlu@bytedance.com \
--cc=bsegall@google.com \
--cc=cgroups@vger.kernel.org \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
--cc=xupengbo@oppo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.