From: Peter Zijlstra <peterz@infradead.org>
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, 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:31:11 +0100 [thread overview]
Message-ID: <20251127083111.GY3245006@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20251126090401.59698-1-wujianyong@hygon.cn>
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?
next prev parent reply other threads:[~2025-11-27 8:31 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 [this message]
2025-11-27 9:43 ` Jianyong Wu
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=20251127083111.GY3245006@noisy.programming.kicks-ass.net \
--to=peterz@infradead.org \
--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=rostedt@goodmis.org \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
--cc=wujianyong@hygon.cn \
/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®