Sched_ext development
 help / color / mirror / Atom feed
From: Andrea Righi <arighi@nvidia.com>
To: Cheng-Yang Chou <yphbchou0911@gmail.com>
Cc: Kuba Piecuch <jpiecuch@google.com>,
	sched-ext@lists.linux.dev, Tejun Heo <tj@kernel.org>,
	David Vernet <void@manifault.com>,
	Changwoo Min <changwoo@igalia.com>,
	Ching-Chun Huang <jserv@ccns.ncku.edu.tw>,
	Chia-Ping Tsai <chia7712@gmail.com>
Subject: Re: [PATCH] tools/sched_ext: Handle pinned tasks in scx_central
Date: Tue, 14 Apr 2026 23:01:00 +0200	[thread overview]
Message-ID: <ad6rDORuL6SAYCN9@gpd4> (raw)
In-Reply-To: <s3khi4ec55rog6tgbgxip5skqjdhimcemhwzf3h7pbbvxslnu7@5r4v7jbv4w7z>

Hi Cheng-Yang,

On Tue, Apr 14, 2026 at 11:45:59AM +0800, Cheng-Yang Chou wrote:
...
> @@ -155,6 +166,13 @@ static bool dispatch_to_cpu(s32 cpu)
>  		if (!bpf_cpumask_test_cpu(cpu, p->cpus_ptr)) {
>  			__sync_fetch_and_add(&nr_mismatches, 1);
>  			scx_bpf_dsq_insert(p, FALLBACK_DSQ_ID, SCX_SLICE_INF, 0);
> +
> +			/*
> +			 * Kick the task's home CPU to pick it up from the
> +			 * fallback DSQ promptly.
> +			 */
> +			scx_bpf_kick_cpu(scx_bpf_task_cpu(p), SCX_KICK_PREEMPT);
> +

You can also pass SCX_ENQ_PREEMPT to scx_bpf_dsq_insert() and avoid calling
scx_bpf_kick_cpu().

More in general, do we really need to preempt the CPU here? It'll be preempted
in the central_timerfn() handler later, right? If we preempt the CPU here we may
have lots of preemption events when many affinitized tasks are running (i.e.,
stress-ng --race-sched 0).

Thanks,
-Andrea

>  			bpf_task_release(p);
>  			/*
>  			 * We might run out of dispatch buffer slots if we continue dispatching
> -- 
> 2.48.1
> 


  parent reply	other threads:[~2026-04-14 21:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-13 11:04 [PATCH] tools/sched_ext: Handle pinned tasks in scx_central Cheng-Yang Chou
2026-04-13 15:29 ` Kuba Piecuch
2026-04-14  3:45   ` Cheng-Yang Chou
2026-04-14 17:19     ` Tejun Heo
2026-04-15  6:17       ` Cheng-Yang Chou
2026-04-15  9:59         ` Kuba Piecuch
2026-04-15 10:07           ` Cheng-Yang Chou
2026-04-17 18:38         ` Tejun Heo
2026-04-14 21:01     ` Andrea Righi [this message]
2026-04-15  6:02       ` Cheng-Yang Chou

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=ad6rDORuL6SAYCN9@gpd4 \
    --to=arighi@nvidia.com \
    --cc=changwoo@igalia.com \
    --cc=chia7712@gmail.com \
    --cc=jpiecuch@google.com \
    --cc=jserv@ccns.ncku.edu.tw \
    --cc=sched-ext@lists.linux.dev \
    --cc=tj@kernel.org \
    --cc=void@manifault.com \
    --cc=yphbchou0911@gmail.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