From: Shrikanth Hegde <sshegde@linux.ibm.com>
To: Vincent Guittot <vincent.guittot@linaro.org>
Cc: qyousef@layalina.io, hongyan.xia2@arm.com,
christian.loehle@arm.com, luis.machado@arm.com, mingo@redhat.com,
peterz@infradead.org, juri.lelli@redhat.com,
dietmar.eggemann@arm.com, rostedt@goodmis.org,
bsegall@google.com, mgorman@suse.de, vschneid@redhat.com,
linux-kernel@vger.kernel.org, pierre.gondois@arm.com,
kprateek.nayak@amd.com
Subject: Re: [PATCH 3/6 v8] sched/fair: Prepare select_task_rq_fair() to be called for new cases
Date: Sun, 7 Dec 2025 18:53:38 +0530 [thread overview]
Message-ID: <07c8435d-c396-4b53-bee5-765469fa8762@linux.ibm.com> (raw)
In-Reply-To: <20251202181242.1536213-4-vincent.guittot@linaro.org>
On 12/2/25 11:42 PM, Vincent Guittot wrote:
> Update select_task_rq_fair() to be called out of the 3 current cases which
> are :
> - wake up
> - exec
> - fork
>
> We wants to select a rq in some new cases like pushing a runnable task on a
> better CPU than the local one. In such case, it's not a wakeup , nor an
> exec nor a fork. We make sure to not distrub these cases but still
nit: s/distrub/disturb
> go through EAS and fast-path.
>
> Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
> ---
> kernel/sched/fair.c | 22 ++++++++++++++--------
> 1 file changed, 14 insertions(+), 8 deletions(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index f430ec890b72..80c4131fb35b 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -8518,6 +8518,7 @@ static int
> select_task_rq_fair(struct task_struct *p, int prev_cpu, int wake_flags)
> {
> int sync = (wake_flags & WF_SYNC) && !(current->flags & PF_EXITING);
> + int want_sibling = !(wake_flags & (WF_EXEC | WF_FORK));
> struct sched_domain *tmp, *sd = NULL;
> int cpu = smp_processor_id();
> int new_cpu = prev_cpu;
> @@ -8535,16 +8536,21 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int wake_flags)
> if ((wake_flags & WF_CURRENT_CPU) &&
> cpumask_test_cpu(cpu, p->cpus_ptr))
> return cpu;
> + }
>
> - if (!is_rd_overutilized(this_rq()->rd)) {
> - new_cpu = find_energy_efficient_cpu(p, prev_cpu);
> - if (new_cpu >= 0)
> - return new_cpu;
> - new_cpu = prev_cpu;
> - }
> + /*
> + * We don't want EAS to be called for exec or fork but it should be
> + * called for any other case such as wake up or push callback.
> + */
> + if (!is_rd_overutilized(this_rq()->rd) && want_sibling) {
> + new_cpu = find_energy_efficient_cpu(p, prev_cpu);
> + if (new_cpu >= 0)
> + return new_cpu;
> + new_cpu = prev_cpu;
> + }
>
> + if (wake_flags & WF_TTWU)
> want_affine = !wake_wide(p) && cpumask_test_cpu(cpu, p->cpus_ptr);
> - }
>
> rcu_read_lock();
> for_each_domain(cpu, tmp) {
> @@ -8575,7 +8581,7 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int wake_flags)
> if (unlikely(sd)) {
> /* Slow path */
> new_cpu = sched_balance_find_dst_cpu(sd, p, cpu, prev_cpu, sd_flag);
> - } else if (wake_flags & WF_TTWU) { /* XXX always ? */
> + } else if (want_sibling) {
It is going to find a idle core withing LLC first. then idle sibling. right?
So may need a better name than want_sibling.
> /* Fast path */
> new_cpu = select_idle_sibling(p, prev_cpu, new_cpu);
> }
next prev parent reply other threads:[~2025-12-07 13:24 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-02 18:12 [PATCH 0/6 v8] sched/fair: Add push task mechanism and handle more EAS cases Vincent Guittot
2025-12-02 18:12 ` [PATCH 1/6 v8] sched/fair: Filter false overloaded_group case for EAS Vincent Guittot
2025-12-02 18:12 ` [PATCH 2/6 v8] sched/fair: Update overutilized detection Vincent Guittot
2026-02-06 17:42 ` Qais Yousef
2025-12-02 18:12 ` [PATCH 3/6 v8] sched/fair: Prepare select_task_rq_fair() to be called for new cases Vincent Guittot
2025-12-07 13:23 ` Shrikanth Hegde [this message]
2026-02-09 13:21 ` Vincent Guittot
2026-02-06 18:03 ` Qais Yousef
2026-02-09 13:21 ` Vincent Guittot
2025-12-02 18:12 ` [PATCH 4/6 v8] sched/fair: Add push task mechanism for fair Vincent Guittot
2025-12-04 10:46 ` Peter Zijlstra
2025-12-04 14:32 ` Vincent Guittot
2025-12-04 11:29 ` Peter Zijlstra
2025-12-04 14:34 ` Vincent Guittot
2025-12-05 8:59 ` Peter Zijlstra
2025-12-05 12:49 ` K Prateek Nayak
2025-12-05 12:56 ` Peter Zijlstra
2025-12-05 13:05 ` K Prateek Nayak
2025-12-05 13:36 ` Vincent Guittot
2025-12-06 3:08 ` K Prateek Nayak
2025-12-05 13:26 ` Vincent Guittot
2025-12-07 12:13 ` Shrikanth Hegde
2026-02-09 13:17 ` Vincent Guittot
2025-12-10 14:01 ` Dietmar Eggemann
2026-02-09 13:17 ` Vincent Guittot
2026-02-06 18:21 ` Qais Yousef
2026-02-09 13:18 ` Vincent Guittot
2025-12-02 18:12 ` [RFC PATCH 5/6 v8] sched/fair: Enable idle core tracking for !SMT Vincent Guittot
2025-12-05 15:52 ` Christian Loehle
2025-12-06 2:11 ` Chen, Yu C
2025-12-06 10:18 ` Vincent Guittot
2025-12-06 10:09 ` Vincent Guittot
2025-12-08 18:43 ` Christian Loehle
2025-12-02 18:12 ` [RFC PATCH 6/6 v8] sched/fair: Add EAS and idle cpu push trigger Vincent Guittot
2026-02-06 18:30 ` Qais Yousef
2026-02-09 13:20 ` Vincent Guittot
2026-02-11 0:59 ` Qais Yousef
2025-12-03 14:06 ` [PATCH 0/6 v8] sched/fair: Add push task mechanism and handle more EAS cases Christian Loehle
2025-12-10 13:30 ` Dietmar Eggemann
2026-02-06 18:32 ` Qais Yousef
2026-02-09 13:20 ` Vincent Guittot
2026-02-26 17:34 ` Pierre Gondois
2026-03-10 4:16 ` Qais Yousef
2026-03-10 10:27 ` Pierre Gondois
2026-03-10 15:11 ` Qais Yousef
2026-03-10 16:59 ` Pierre Gondois
2026-03-12 8:19 ` Vincent Guittot
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=07c8435d-c396-4b53-bee5-765469fa8762@linux.ibm.com \
--to=sshegde@linux.ibm.com \
--cc=bsegall@google.com \
--cc=christian.loehle@arm.com \
--cc=dietmar.eggemann@arm.com \
--cc=hongyan.xia2@arm.com \
--cc=juri.lelli@redhat.com \
--cc=kprateek.nayak@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luis.machado@arm.com \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=pierre.gondois@arm.com \
--cc=qyousef@layalina.io \
--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®