From: Daniel Jordan <daniel.m.jordan@oracle.com>
To: arighi@nvidia.com
Cc: changwoo@igalia.com, christian.loehle@arm.com,
emil@etsalapatis.com, hodgesd@meta.com, jpiecuch@google.com,
linux-kernel@vger.kernel.org, sched-ext@lists.linux.dev,
tj@kernel.org, void@manifault.com, daniel.m.jordan@oracle.com
Subject: Re: [PATCH 4/4] selftests/sched_ext: Add test to validate ops.dequeue() semantics
Date: Fri, 20 Feb 2026 21:26:51 -0500 [thread overview]
Message-ID: <20260221022651.59391-1-daniel.m.jordan@oracle.com> (raw)
In-Reply-To: <20260218083703.22785-5-arighi@nvidia.com>
Hi Andrea,
Looks clean, runs fine.
Reviewed-by: Daniel Jordan <daniel.m.jordan@oracle.com>
All minor stuff, no need for a respin here in v10.
> diff --git a/tools/testing/selftests/sched_ext/dequeue.bpf.c b/tools/testing/selftests/sched_ext/dequeue.bpf.c
> +/*
> + * Per-task state to track lifecycle and validate workflow semantics.
> + * State transitions:
> + * NONE -> ENQUEUED (on enqueue)
> + * ENQUEUED -> DISPATCHED (on dispatch dequeue)
> + * DISPATCHED -> NONE (on property change dequeue or re-enqueue)
> + * ENQUEUED -> NONE (on property change dequeue before dispatch)
NONE -> DISPATCHED is a valid transition too.
> +void BPF_STRUCT_OPS(dequeue_enqueue, struct task_struct *p, u64 enq_flags)
> +{
> + struct task_ctx *tctx;
> + s32 pid = p->pid;
> +
> + tctx = try_lookup_task_ctx(p);
> + if (!tctx)
> + return;
> +
> + switch (test_scenario) {
> + case 3:
> + /*
> + * Direct dispatch to the local DSQ.
> + *
> + * Task bypasses BPF scheduler entirely: no enqueue
> + * tracking, no ops.dequeue() callbacks.
> + */
> + scx_bpf_dsq_insert(p, SCX_DSQ_LOCAL, SCX_SLICE_DFL, enq_flags);
Could do with
tctx->state = TASK_DISPATCHED;
> + break;
> + case 4:
> + /*
> + * Direct dispatch to the global DSQ.
> + *
> + * Task bypasses BPF scheduler entirely: no enqueue
> + * tracking, no ops.dequeue() callbacks.
> + */
> + scx_bpf_dsq_insert(p, SCX_DSQ_GLOBAL, SCX_SLICE_DFL, enq_flags);
...and also here
tctx->state = TASK_DISPATCHED;
to be consistent with how select_cpu sets this state, but I don't think setting
DISPATCHED has any effect in select_cpu or here.
> +void BPF_STRUCT_OPS(dequeue_dequeue, struct task_struct *p, u64 deq_flags)
...
> + } else {
...
> + /*
> + * Dispatch dequeue should not have %SCX_DEQ_SCHED_CHANGE
> + * flag.
> + */
> + if (deq_flags & SCX_DEQ_SCHED_CHANGE)
> + scx_bpf_error("%d (%s): SCX_DEQ_SCHED_CHANGE in dispatch dequeue seq=%llu",
> + p->pid, p->comm, tctx->enqueue_seq);
This 'if' can be deleted.
next prev parent reply other threads:[~2026-02-21 2:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-18 8:32 [PATCHSET v10] sched_ext: Fix " Andrea Righi
2026-02-18 8:32 ` [PATCH 1/4] sched_ext: Properly mark SCX-internal migrations via sticky_cpu Andrea Righi
2026-02-18 8:32 ` [PATCH 2/4] sched_ext: Add rq parameter to dispatch_enqueue() Andrea Righi
2026-02-18 8:32 ` [PATCH 3/4] sched_ext: Fix ops.dequeue() semantics Andrea Righi
2026-02-18 8:32 ` [PATCH 4/4] selftests/sched_ext: Add test to validate " Andrea Righi
2026-02-21 2:26 ` Daniel Jordan [this message]
2026-02-21 20:02 ` [PATCH v2 " Andrea Righi
2026-02-23 20:11 ` [PATCHSET v10] sched_ext: Fix " Tejun Heo
-- strict thread matches above, loose matches on Subject: below --
2026-02-15 19:16 [PATCHSET v9] " Andrea Righi
2026-02-15 19:16 ` [PATCH 4/4] selftests/sched_ext: Add test to validate " 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=20260221022651.59391-1-daniel.m.jordan@oracle.com \
--to=daniel.m.jordan@oracle.com \
--cc=arighi@nvidia.com \
--cc=changwoo@igalia.com \
--cc=christian.loehle@arm.com \
--cc=emil@etsalapatis.com \
--cc=hodgesd@meta.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®