mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Andrea Righi <andrea.righi@linux.dev>
Cc: David Vernet <void@manifault.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sched_ext: improve WAKE_SYNC behavior for default idle CPU selection
Date: Fri, 18 Oct 2024 07:38:10 -1000	[thread overview]
Message-ID: <ZxKdAvnLOmzPH4in@slm.duckdns.org> (raw)
In-Reply-To: <20241018094033.160188-1-andrea.righi@linux.dev>

Hello,

On Fri, Oct 18, 2024 at 11:40:33AM +0200, Andrea Righi wrote:
...
> +	 * If WAKE_SYNC, try to migrate the wakee to the waker's CPU.
> +	 */
> +	if (wake_flags & SCX_WAKE_SYNC) {
> +		cpu = smp_processor_id();
> +
> +		/*
> +		 * If the waker's CPU is cache affine and prev_cpu is idle,
> +		 * then avoid a migration.
> +		 */
> +		if (cpus_share_cache(cpu, prev_cpu) &&
> +		    test_and_clear_cpu_idle(prev_cpu))
>  			goto cpu_found;

Shouldn't this do set cpu to prev_cpu before jumping to cpu_found?

Thanks.

-- 
tejun

  reply	other threads:[~2024-10-18 17:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-18  9:40 Andrea Righi
2024-10-18 17:38 ` Tejun Heo [this message]
2024-10-18 17:58   ` Andrea Righi

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=ZxKdAvnLOmzPH4in@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=andrea.righi@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=void@manifault.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®