From: Peter Zijlstra <peterz@infradead.org>
To: K Prateek Nayak <kprateek.nayak@amd.com>
Cc: mingo@kernel.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, vschneid@redhat.com,
ziqianlu@bytedance.com, tj@kernel.org, williams@redhat.com,
jkacur@redhat.com
Subject: Re: [PATCH 1/2] sched/core: Allow newidle for core-sched
Date: Thu, 25 Jun 2026 14:42:13 +0200 [thread overview]
Message-ID: <20260625124213.GX42921@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <b2acc7f1-f119-4707-b10f-52e9b6ad0b49@amd.com>
On Thu, Jun 25, 2026 at 05:26:03AM +0530, K Prateek Nayak wrote:
> ... or we can return a RETRY_TASK when newidle balance succeeds too to
> force a core-wide pick when core scheduling is enabled like:
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 0d212bf04885..e393aed58bfa 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -9946,8 +9946,16 @@ struct task_struct *pick_task_fair(struct rq *rq, struct rq_flags *rf)
> if (rq_modified_above(rq, &fair_sched_class))
> return RETRY_TASK;
>
> - if (cfs_rq->nr_queued)
> + if (cfs_rq->nr_queued) {
> + /*
> + * Force a core-wide pick if newidle
> + * balance managed to pull a task since
> + * the lock was dropped.
> + */
> + if (sched_core_enabled(rq))
> + return RETRY_TASK;
> goto again;
> + }
>
> return NULL;
> }
This has forward progress issues. You can ping-pong he one task back and
forth and never actually pick anything.
next prev parent reply other threads:[~2026-06-25 12:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-24 12:13 [PATCH 0/2] sched: Remove sched_class::balance() Peter Zijlstra
2026-06-24 12:13 ` [PATCH 1/2] sched/core: Allow newidle for core-sched Peter Zijlstra
2026-06-24 23:56 ` K Prateek Nayak
2026-06-25 12:41 ` Peter Zijlstra
2026-06-25 12:42 ` Peter Zijlstra [this message]
2026-06-24 12:13 ` [PATCH 2/2] sched: Remove sched_class::balance() Peter Zijlstra
2026-07-02 11:49 ` [PATCH 0/2] " Aaron Lu
2026-07-03 3:31 ` K Prateek Nayak
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=20260625124213.GX42921@noisy.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=jkacur@redhat.com \
--cc=juri.lelli@redhat.com \
--cc=kprateek.nayak@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@kernel.org \
--cc=rostedt@goodmis.org \
--cc=tj@kernel.org \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
--cc=williams@redhat.com \
--cc=ziqianlu@bytedance.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.