mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joseph Salisbury <joseph.salisbury@oracle.com>
To: Andrea Righi <arighi@nvidia.com>
Cc: Tejun Heo <tj@kernel.org>, David Vernet <void@manifault.com>,
	Changwoo Min <changwoo@igalia.com>,
	Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Valentin Schneider <vschneid@redhat.com>,
	sched-ext@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [External] : Re: [PATCH] sched_ext: idle: use active idle domain in WAKE_SYNC check
Date: Thu, 26 Mar 2026 14:19:40 -0400	[thread overview]
Message-ID: <5601bd76-61b4-4544-94c8-b93dc9d27349@oracle.com> (raw)
In-Reply-To: <acRusibUxjWj3WCW@gpd4>



On 3/25/26 7:24 PM, Andrea Righi wrote:
> Hi Joe,
>
> On Tue, Mar 24, 2026 at 03:58:36PM -0400, Joseph Salisbury wrote:
>> The WAKE_SYNC fast path checks whether there are idle CPUs before
>> biasing wakeups to the waker CPU.  After per-node idle masks were
>> introduced, this path started indexing idle_cpumask() with
>> cpu_to_node().
>>
>> When per-node idle tracking is disabled, per-node masks are not kept in
>> sync and may be stale.  Reading them here can mis-detect system
>> utilization and lead to incorrect WAKE_SYNC wakeup placement.
>>
>> Use scx_cpu_node_if_enabled() for the waker node lookup so this check
>> uses the global idle mask when per-node tracking is disabled and the
>> per-node mask only when that mode is enabled.
>>
>> Fixes: 48849271e661 ("sched_ext: idle: Per-node idle cpumasks")
>> Cc: stable@vger.kernel.org # v6.15+
>> Assisted-by: Codex:GPT-5
>> Signed-off-by: Joseph Salisbury <joseph.salisbury@oracle.com>
> This is good, but it's already fixed:
> https://urldefense.com/v3/__https://lore.kernel.org/all/20260321105503.869337-1-yphbchou0911@gmail.com__;!!ACWV5N9M2RV99hQ!M88Tr7SYG3FHedTvBFVj_5kAPCVI-WVHWNdHhvaysPHoUD3qbj9bZ8kNj8TwcjHXNvVTnhx0BvGh7pM5R6fC$
>
> You can probably use Tejun's branch to search for new issues/bugs:
>
>   git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext.git
Thanks for the pointer!  I'll review this branch prior to sending/fixing 
any more bugs.
>
> Thanks,
> -Andrea
>
>> ---
>>   kernel/sched/ext_idle.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/kernel/sched/ext_idle.c b/kernel/sched/ext_idle.c
>> index 8cfe0e9a7319..6b4520ed563d 100644
>> --- a/kernel/sched/ext_idle.c
>> +++ b/kernel/sched/ext_idle.c
>> @@ -543,7 +543,7 @@ s32 scx_select_cpu_dfl(struct task_struct *p, s32 prev_cpu, u64 wake_flags,
>>   		 * piled up on it even if there is an idle core elsewhere on
>>   		 * the system.
>>   		 */
>> -		waker_node = cpu_to_node(cpu);
>> +		waker_node = scx_cpu_node_if_enabled(cpu);
>>   		if (!(current->flags & PF_EXITING) &&
>>   		    cpu_rq(cpu)->scx.local_dsq.nr == 0 &&
>>   		    (!(flags & SCX_PICK_IDLE_IN_NODE) || (waker_node == node)) &&
>> -- 
>> 2.47.3


      reply	other threads:[~2026-03-26 18:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-24 19:58 Joseph Salisbury
2026-03-25 23:24 ` Andrea Righi
2026-03-26 18:19   ` Joseph Salisbury [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=5601bd76-61b4-4544-94c8-b93dc9d27349@oracle.com \
    --to=joseph.salisbury@oracle.com \
    --cc=arighi@nvidia.com \
    --cc=bsegall@google.com \
    --cc=changwoo@igalia.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=sched-ext@lists.linux.dev \
    --cc=tj@kernel.org \
    --cc=vincent.guittot@linaro.org \
    --cc=void@manifault.com \
    --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®