mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrea Righi <arighi@nvidia.com>
To: Kuba Piecuch <jpiecuch@google.com>
Cc: Tejun Heo <tj@kernel.org>, David Vernet <void@manifault.com>,
	Changwoo Min <changwoo@igalia.com>,
	Emil Tsalapatis <emil@etsalapatis.com>,
	sched-ext@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] selftests/sched_ext: Add a test for ops.dequeue() on remote local DSQ moves
Date: Tue, 29 Sep 2026 20:42:40 +0200	[thread overview]
Message-ID: <arwGoJF3PMV7llAK@gpd4> (raw)
In-Reply-To: <20260929161730.185271-2-jpiecuch@google.com>

Hi Kuba,

On Tue, Sep 29, 2026 at 04:17:24PM +0000, Kuba Piecuch wrote:
> When a BPF scheduler moves a task that is in its custody to the local DSQ
> of a CPU other than the one whose rq the task is on, sched_ext migrates the
> task with move_remote_task_to_local_dsq(). The task leaves the BPF
> scheduler's custody when it is inserted into the destination local DSQ and
> ops.dequeue() should be called at that point, just like for same-rq
> dispatches.
> 
> Add a dequeue_remote test that exercises this path. All tasks are put
> into custody from ops.enqueue() and moved to the local DSQ of whichever
> CPU runs ops.dispatch(), so that most moves cross CPUs. Two variants are
> covered, selected by test_use_move_to_local:
> 
>  - false: tasks are queued in a BPF queue and dispatched with
>    scx_bpf_dsq_insert(SCX_DSQ_LOCAL_ON | cpu), going through
>    dispatch_to_local_dsq(),
> 
>  - true: tasks are queued on a user DSQ and consumed with
>    scx_bpf_dsq_move_to_local(), going through consume_remote_task().
> 
> The BPF scheduler tracks each task's custody state and triggers
> scx_bpf_error() if:
> 
>  - ops.dequeue() is called with SCX_DEQ_CORE_SCHED_EXEC, meaning that
>    the custody exit was missed on insertion into the local DSQ and
>    deferred to set_next_task_scx(),
> 
>  - a task starts running without ops.dequeue() having been called since
>    its last ops.enqueue(),
> 
>  - ops.dequeue() is called for a task that isn't in custody, or
>    ops.enqueue() for a task that is.
> 
> Core scheduling can legitimately pick tasks straight out of custody, so
> the test is skipped if any task has a core scheduling cookie when it
> starts.
> 
> The test currently fails:
> 
>   sched_ext: dequeue_remote: dequeue_remote.bpf.c:143: 156 (runner): late ops.dequeue() with SCX_DEQ_CORE_SCHED_EXEC (enq_cpu=1 cpu=3 seq=1)
>      ...
>      ops_dequeue+0x114/0x170
>      set_next_task_scx+0x104/0x1e0
>      __pick_next_task+0xc7/0x180
>      __schedule+0x154/0x1870
> 
> so don't add it to auto-test-targets yet. It will be enabled once the
> underlying bug is fixed.
> 
> Assisted-by: Claude:claude-opus-5.5
> Signed-off-by: Kuba Piecuch <jpiecuch@google.com>

We can probably fold the this into PATCH 3.

Thanks,
-Andrea

  reply	other threads:[~2026-09-29 18:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-29 16:17 [PATCHSET sched_ext/for-7.3-fixes] sched_ext: Fix missing " Kuba Piecuch
2026-09-29 16:17 ` [PATCH 1/3] selftests/sched_ext: Add a test for " Kuba Piecuch
2026-09-29 18:42   ` Andrea Righi [this message]
2026-09-30 11:50     ` Kuba Piecuch
2026-09-29 16:17 ` [PATCH 2/3] sched_ext: Call ops.dequeue() when a task arrives on a remote local DSQ Kuba Piecuch
2026-09-29 18:33   ` Andrea Righi
2026-09-30 11:50     ` Kuba Piecuch
2026-09-29 16:17 ` [PATCH 3/3] selftests/sched_ext: Enable the dequeue_remote test Kuba Piecuch
2026-09-29 17:13 ` [PATCHSET sched_ext/for-7.3-fixes] sched_ext: Fix missing ops.dequeue() on remote local DSQ moves Tejun Heo
2026-09-29 18:30   ` Andrea Righi
2026-09-30 11:50   ` Kuba Piecuch

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=arwGoJF3PMV7llAK@gpd4 \
    --to=arighi@nvidia.com \
    --cc=changwoo@igalia.com \
    --cc=emil@etsalapatis.com \
    --cc=jpiecuch@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sched-ext@lists.linux.dev \
    --cc=tj@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®