From: Cheng-Yang Chou <yphbchou0911@gmail.com>
To: Andrea Righi <arighi@nvidia.com>
Cc: Tejun Heo <tj@kernel.org>, David Vernet <void@manifault.com>,
Changwoo Min <changwoo@igalia.com>,
Emil Tsalapatis <etsal@meta.com>,
sched-ext@lists.linux.dev, linux-kernel@vger.kernel.org,
Ching-Chun Huang <jserv@ccns.ncku.edu.tw>,
Chia-Ping Tsai <chia7712@gmail.com>,
chengyang.chou@mediatek.com
Subject: Re: [PATCH 2/2] selftests/sched_ext: Add lazy preemption tests
Date: Mon, 14 Sep 2026 22:55:56 +0800 [thread overview]
Message-ID: <20260914225115.Gb03c@cchengyang.duckdns.org> (raw)
In-Reply-To: <20260914084955.1798562-3-arighi@nvidia.com>
Hi Andrea,
On Mon, Sep 14, 2026 at 10:47:46AM +0200, Andrea Righi wrote:
> Add trace-based coverage for immediate and lazy preemption. An fexit
> probe on __resched_curr() records the requested TIF and the current task
> slice, while the stopping callback verifies that the task reaches a
> scheduling boundary.
>
> Exercise kick requests individually, in both orders and combined in one
> call. Verify that immediate preemption and WAIT take precedence over
> lazy preemption, and that combining immediate and lazy enqueue
> preemption follows the same rule. Also test overriding the expiry
> default in both directions through scx_bpf_task_set_slice_expiry().
>
> Extend the NO_HZ_FULL test with infinite-slice victims. Verify that lazy
> enqueue and kick requests restart a stopped tick and make forward
> progress. Keep invalid kick flag coverage and skip modes not exposed by
> the running kernel.
>
> Signed-off-by: Andrea Righi <arighi@nvidia.com>
[...]
Didn't have time to go through the whole series, but I applied it on
for-next and built with PREEMPT_LAZY=y and PREEMPT_DYNAMIC=n:
INFO: preemption mode unavailable; lazy TIF was 5, immediate TIF was 4
ok 2 kick_lazy #
INFO: preemption mode unavailable; lazy TIF was 5, immediate TIF was 4
ok 4 kick_tick #
PASSED: 6
> +static int active_lazy_mode(void)
> +{
> + char buf[128];
> + FILE *file;
> +
> + file = fopen("/sys/kernel/debug/sched/preempt", "r");
> + if (!file)
> + return -1;
sched_init_debug() only creates that file under CONFIG_PREEMPT_DYNAMIC,
and PREEMPT_LAZY can be built without it ("select PREEMPT_BUILD if
!PREEMPT_DYNAMIC"), so the two tests pass without comparing the TIFs.
Would something like this work?
if (!file) {
#if defined(CONFIG_PREEMPT_LAZY) && !defined(CONFIG_PREEMPT_DYNAMIC)
return 1;
#else
return -1;
#endif
}
Thanks.
> + if (!fgets(buf, sizeof(buf), file)) {
> + fclose(file);
> + return -1;
> + }
> + fclose(file);
> +
> + if (strstr(buf, "(lazy)"))
> + return 1;
> + if (strstr(buf, "(full)"))
> + return 0;
> + return -1;
> +}
> +
--
Cheers,
Cheng-Yang
next prev parent reply other threads:[~2026-09-14 14:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-14 8:47 [PATCHSET v2 sched_ext/for-7.4] sched_ext: Add lazy preemption support Andrea Righi
2026-09-14 8:47 ` [PATCH 1/2] " Andrea Righi
2026-09-14 8:47 ` [PATCH 2/2] selftests/sched_ext: Add lazy preemption tests Andrea Righi
2026-09-14 14:55 ` Cheng-Yang Chou [this message]
2026-09-15 13:35 ` Andrea Righi
2026-09-14 14:44 [PATCHSET v3 sched_ext/for-7.4] sched_ext: Add lazy preemption support Andrea Righi
2026-09-14 14:44 ` [PATCH 2/2] selftests/sched_ext: Add lazy preemption tests Andrea Righi
2026-09-15 9:00 [PATCHSET v4 sched_ext/for-7.4] sched_ext: Add lazy preemption support Andrea Righi
2026-09-15 9:00 ` [PATCH 2/2] selftests/sched_ext: Add lazy preemption tests Andrea Righi
2026-09-15 19:45 [PATCHSET v5 sched_ext/for-7.4] sched_ext: Add lazy preemption support Andrea Righi
2026-09-15 19:45 ` [PATCH 2/2] selftests/sched_ext: Add lazy preemption tests 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=20260914225115.Gb03c@cchengyang.duckdns.org \
--to=yphbchou0911@gmail.com \
--cc=arighi@nvidia.com \
--cc=changwoo@igalia.com \
--cc=chengyang.chou@mediatek.com \
--cc=chia7712@gmail.com \
--cc=etsal@meta.com \
--cc=jserv@ccns.ncku.edu.tw \
--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®