mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jianyong Wu <wujianyong@hygon.cn>
To: Peter Zijlstra <peterz@infradead.org>
Cc: "mingo@redhat.com" <mingo@redhat.com>,
	"juri.lelli@redhat.com" <juri.lelli@redhat.com>,
	"vincent.guittot@linaro.org" <vincent.guittot@linaro.org>,
	"dietmar.eggemann@arm.com" <dietmar.eggemann@arm.com>,
	"rostedt@goodmis.org" <rostedt@goodmis.org>,
	"bsegall@google.com" <bsegall@google.com>,
	"mgorman@suse.de" <mgorman@suse.de>,
	"vschneid@redhat.com" <vschneid@redhat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"jianyong.wu@outlook.com" <jianyong.wu@outlook.com>,
	Yibin Liu <liuyibin@hygon.cn>
Subject: RE: [PATCH] sched/core: avoid calling select_task_rq if bound to one CPU for exec
Date: Thu, 27 Nov 2025 09:43:52 +0000	[thread overview]
Message-ID: <369e570a88114183ae48c918c0f500f6@hygon.cn> (raw)
In-Reply-To: <20251127083111.GY3245006@noisy.programming.kicks-ass.net>

Hi Peter,

Thanks for reply.

> -----Original Message-----
> From: Peter Zijlstra <peterz@infradead.org>
> Sent: Thursday, November 27, 2025 4:31 PM
> To: Jianyong Wu <wujianyong@hygon.cn>
> Cc: mingo@redhat.com; juri.lelli@redhat.com; vincent.guittot@linaro.org;
> dietmar.eggemann@arm.com; rostedt@goodmis.org; bsegall@google.com;
> mgorman@suse.de; vschneid@redhat.com; linux-kernel@vger.kernel.org;
> jianyong.wu@outlook.com; Yibin Liu <liuyibin@hygon.cn>
> Subject: Re: [PATCH] sched/core: avoid calling select_task_rq if bound to one
> CPU for exec
> 
> On Wed, Nov 26, 2025 at 05:04:01PM +0800, Jianyong Wu wrote:
> 
> >  kernel/sched/core.c | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/kernel/sched/core.c b/kernel/sched/core.c index
> > f754a60de848..c1e9f633cfb0 100644
> > --- a/kernel/sched/core.c
> > +++ b/kernel/sched/core.c
> > @@ -5442,7 +5442,11 @@ void sched_exec(void)
> >  	int dest_cpu;
> >
> >  	scoped_guard (raw_spinlock_irqsave, &p->pi_lock) {
> > -		dest_cpu = p->sched_class->select_task_rq(p, task_cpu(p), WF_EXEC);
> > +		if (p->nr_cpus_allowed > 1 && !is_migration_disabled(p))
> > +			dest_cpu = p->sched_class->select_task_rq(p, task_cpu(p),
> WF_EXEC);
> > +		else
> > +			dest_cpu = cpumask_any(p->cpus_ptr);
> > +
> 
> Instead of duplicating this, could we not just call select_task_rq() here?

Do you mean using select_task_rq() instead of making these changes? I think that works. I'll make this change in the next version.

Thanks
Jianyong


      reply	other threads:[~2025-11-27  9:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-26  9:04 Jianyong Wu
2025-11-27  8:31 ` Peter Zijlstra
2025-11-27  9:43   ` Jianyong Wu [this message]

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=369e570a88114183ae48c918c0f500f6@hygon.cn \
    --to=wujianyong@hygon.cn \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=jianyong.wu@outlook.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuyibin@hygon.cn \
    --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 \
    /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®