[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6e771747-ba73-4a6a-9982-05fea69136a4@linux.ibm.com>
Date: Thu, 25 Sep 2025 12:05:45 +0530
From: Madadi Vineeth Reddy <vineethr@...ux.ibm.com>
To: K Prateek Nayak <kprateek.nayak@....com>,
Fernand Sieber <sieberf@...zon.com>
Cc: mingo@...hat.com, peterz@...radead.org, linux-kernel@...r.kernel.org,
juri.lelli@...hat.com, vincent.guittot@...aro.org,
dietmar.eggemann@....com, rostedt@...dmis.org, bsegall@...gle.com,
mgorman@...e.de, bristot@...hat.com, vschneid@...hat.com,
dwmw@...zon.co.uk, jschoenh@...zon.de, liuyuxua@...zon.com,
Madadi Vineeth Reddy <vineethr@...ux.ibm.com>
Subject: Re: [PATCH 1/4] sched/fair: Fix cookie check on __select_idle_cpu()
Hi Prateek,
On 23/09/25 14:12, K Prateek Nayak wrote:
> Hello Fernand,
>
> On 9/22/2025 6:09 PM, Fernand Sieber wrote:
>> @@ -7447,7 +7447,7 @@ static inline int sched_balance_find_dst_cpu(struct sched_domain *sd, struct tas
>> static inline int __select_idle_cpu(int cpu, struct task_struct *p)
>> {
>> if ((available_idle_cpu(cpu) || sched_idle_cpu(cpu)) &&
>> - sched_cpu_cookie_match(cpu_rq(cpu), p))
>> + sched_core_cookie_match(cpu_rq(cpu), p))
>
> __select_idle_cpu() is only called when "has_idle_core" is false which
> means it is highly unlikely we'll find an idle core. In such cases, just
> matching the cookie should be sufficient right?
Agreed. The only code path I could find where __select_idle_cpu() is called
with has_idle_core == true is in the non-CONFIG_SCHED_SMT case, which is not
relevant to core scheduling.
Thanks,
Madadi Vineeth Reddy
>
> Do you have any benchmark numbers which shows a large difference with
> these changes?
>
>> return cpu;
>>
>> return -1;
>> @@ -7546,6 +7546,9 @@ static int select_idle_smt(struct task_struct *p, struct sched_domain *sd, int t
>> {
>> int cpu;
>>
>> + if (!sched_core_cookie_match(cpu_rq(target), p))
>> + return -1;
>> +
>
> select_idle_smt() is again called when "has_idle_core" is false and
> sched_cpu_cookie_match() should be sufficient for most part here too.
>
>> for_each_cpu_and(cpu, cpu_smt_mask(target), p->cpus_ptr) {
>> if (cpu == target)
>> continue;
>
Powered by blists - more mailing lists