[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <369e570a88114183ae48c918c0f500f6@hygon.cn>
Date: Thu, 27 Nov 2025 09:43:52 +0000
From: Jianyong Wu <wujianyong@...on.cn>
To: Peter Zijlstra <peterz@...radead.org>
CC: "mingo@...hat.com" <mingo@...hat.com>, "juri.lelli@...hat.com"
<juri.lelli@...hat.com>, "vincent.guittot@...aro.org"
<vincent.guittot@...aro.org>, "dietmar.eggemann@....com"
<dietmar.eggemann@....com>, "rostedt@...dmis.org" <rostedt@...dmis.org>,
"bsegall@...gle.com" <bsegall@...gle.com>, "mgorman@...e.de"
<mgorman@...e.de>, "vschneid@...hat.com" <vschneid@...hat.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"jianyong.wu@...look.com" <jianyong.wu@...look.com>, Yibin Liu
<liuyibin@...on.cn>
Subject: RE: [PATCH] sched/core: avoid calling select_task_rq if bound to one
CPU for exec
Hi Peter,
Thanks for reply.
> -----Original Message-----
> From: Peter Zijlstra <peterz@...radead.org>
> Sent: Thursday, November 27, 2025 4:31 PM
> To: Jianyong Wu <wujianyong@...on.cn>
> 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; linux-kernel@...r.kernel.org;
> jianyong.wu@...look.com; Yibin Liu <liuyibin@...on.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
Powered by blists - more mailing lists