mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Madadi Vineeth Reddy <vineethr@linux.ibm.com>
To: K Prateek Nayak <kprateek.nayak@amd.com>,
	Fernand Sieber <sieberf@amazon.com>
Cc: mingo@redhat.com, peterz@infradead.org,
	linux-kernel@vger.kernel.org, juri.lelli@redhat.com,
	vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
	rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
	bristot@redhat.com, vschneid@redhat.com, dwmw@amazon.co.uk,
	jschoenh@amazon.de, liuyuxua@amazon.com,
	Madadi Vineeth Reddy <vineethr@linux.ibm.com>
Subject: Re: [PATCH 1/4] sched/fair: Fix cookie check on __select_idle_cpu()
Date: Thu, 25 Sep 2025 12:05:45 +0530	[thread overview]
Message-ID: <6e771747-ba73-4a6a-9982-05fea69136a4@linux.ibm.com> (raw)
In-Reply-To: <f341531d-d65d-4063-9b0c-8d47b49864db@amd.com>

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;
> 


  reply	other threads:[~2025-09-25  6:36 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-22 12:39 [PATCH 0/4] sched/fair: Core sched wake up path improvements Fernand Sieber
2025-09-22 12:39 ` [PATCH 1/4] sched/fair: Fix cookie check on __select_idle_cpu() Fernand Sieber
2025-09-23  8:42   ` K Prateek Nayak
2025-09-25  6:35     ` Madadi Vineeth Reddy [this message]
2025-09-22 12:39 ` [PATCH 2/4] sched/fair: Still look for the idlest cpu with no matching cookie Fernand Sieber
2025-09-23  1:51   ` K Prateek Nayak
2025-09-23  7:32     ` Fernand Sieber
2025-09-23  7:44       ` Fernand Sieber
2025-09-22 12:39 ` [PATCH 3/4] sched/fair: Add cookie checks on wake idle path Fernand Sieber
2025-09-22 12:39 ` [PATCH 4/4] sched/fair: Add more core cookie check in wake up fast path Fernand Sieber
2025-09-23  8:55   ` K Prateek Nayak
2025-09-23  9:30     ` Fernand Sieber
2025-09-24  4:21       ` K Prateek Nayak
2025-11-05 15:34         ` [PATCH 4/4] sched/fair: Add more core cookie check in wake up Fernand Sieber
2025-11-20 10:30         ` [PATCH 4/4] sched/fair: Add more core cookie check in wake up fast path Fernand Sieber

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=6e771747-ba73-4a6a-9982-05fea69136a4@linux.ibm.com \
    --to=vineethr@linux.ibm.com \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=dwmw@amazon.co.uk \
    --cc=jschoenh@amazon.de \
    --cc=juri.lelli@redhat.com \
    --cc=kprateek.nayak@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuyuxua@amazon.com \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=sieberf@amazon.com \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®