[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tencent_864D604B16C284549B49EAD596815A2A7606@qq.com>
Date: Wed, 15 Oct 2025 16:41:07 +0800
From: Chen Yu <yu.chen.surf@...mail.com>
To: Peter Zijlstra <peterz@...radead.org>,
Adam Li <adamli@...amperecomputing.com>
Cc: mingo@...hat.com, juri.lelli@...hat.com, vincent.guittot@...aro.org,
dietmar.eggemann@....com, rostedt@...dmis.org, bsegall@...gle.com,
mgorman@...e.de, vschneid@...hat.com, cl@...ux.com,
linux-kernel@...r.kernel.org, patches@...erecomputing.com,
shkaushik@...erecomputing.com
Subject: Re: [PATCH RESEND] sched/fair: Only update stats for allowed CPUs
when looking for dst group
On 10/14/25 19:37, Peter Zijlstra wrote:
> On Sat, Oct 11, 2025 at 06:43:22AM +0000, Adam Li wrote:
>> Load imbalance is observed when the workload frequently forks new threads.
>> Due to CPU affinity, the workload can run on CPU 0-7 in the first
>> group, and only on CPU 8-11 in the second group. CPU 12-15 are always idle.
>>
>> { 0 1 2 3 4 5 6 7 } {8 9 10 11 12 13 14 15}
>> * * * * * * * * * * * *
>>
>> When looking for dst group for newly forked threads, in many times
>> update_sg_wakeup_stats() reports the second group has more idle CPUs
>> than the first group. The scheduler thinks the second group is less
>> busy. Then it selects least busy CPUs among CPU 8-11. Therefore CPU 8-11
>> can be crowded with newly forked threads, at the same time CPU 0-7
>> can be idle.
>>
>> A task may not use all the CPUs in a schedule group due to CPU affinity.
>> Only update schedule group statistics for allowed CPUs.
>>
>> Signed-off-by: Adam Li <adamli@...amperecomputing.com>
>> ---
>> Resending this patch from the patchset:
>> https://lore.kernel.org/lkml/20250717062036.432243-2-adamli@os.amperecomputing.com/
>>
>
> Right, lets start with this then ;-)
>
> No need to do the cpumask_and() thing, that's just more changes vs
> update_sg_lb_stats().
>
I just saw Peter's comments on this. I'm OK with the current
version and Adam please feel free to keep my Reviewed-by tag
for this non-cpumask_and version.
thanks,
Chenyu
Powered by blists - more mailing lists