From: sashiko-bot@kernel.org
To: "Mathieu Desnoyers" <mathieu.desnoyers@efficios.com>
Cc: linux-rt-devel@lists.linux.dev, tj@kernel.org,
hannes@cmpxchg.org, mkoutny@suse.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v8 18/33] selftests/sched: Test the root domain of a task in deadline_bw_test
Date: Thu, 19 Nov 2026 20:27:18 +0000 [thread overview]
Message-ID: <sashiko-outbox-224019@kernel.org> (raw)
In-Reply-To: <55480cfbc5c82f022d2f7c4d1ac721ea50e5dfe3.1795116791.git.mathieu.desnoyers@efficios.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] selftests/sched: missing 0-lag sleep on goto out in
hotplug_dead_accepted()
--
commit 18c7a84e3237184ed7ce53936729cf7fbe932760
Author: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
selftests/sched: Test the root domain of a task in deadline_bw_test
This commit adds 24 test cases to deadline_bw_test covering how a deadline
task stays in the root domain that accounts for its bandwidth across CPU
hotplug and cpuset changes.
> diff --git a/tools/testing/selftests/sched/deadline/deadline_bw_test.c b/tools/testing/selftests/sched/deadline/deadline_bw_test.c
> index fa1ff62d6f42f..a290e332831d6 100644
> --- a/tools/testing/selftests/sched/deadline/deadline_bw_test.c
> +++ b/tools/testing/selftests/sched/deadline/deadline_bw_test.c
[ ... ]
> @@ -7014,6 +7562,1368 @@ static int move_back_cpu_offline(void)
[ ... ]
> +static int hotplug_dead_accepted(void)
> +{
> + int fd[2] = { -1, -1 }, err, cpu, ret = KSFT_SKIP;
> + long long def0, hk0, def, hk;
> + uint64_t t;
> + char buf[64];
> + pid_t pid = -1;
[ ... ]
> + pid = task_from(fb_h, 1, 100 * NSEC_PER_MSEC, NSEC_PER_SEC, fd[0]);
> + if (pid < 0 || child_up("hotplug_dead_accepted", 0) ||
> + wait_for(1000, proc_state_of(pid) == 'S'))
> + goto out;
> + err = enter(cs_b, pid);
> + if (err) {
> + ksft_print_msg("a move into B refused: %s\n", strerror(-err));
> + goto out;
> + }
> + if (fallback_totals(&def, &hk))
> + goto out;
> + cpu = task_cpu_of(pid);
> + if (cpu != fb_h || def != def0 || hk <= hk0) {
> + ksft_print_msg("in B on CPU %d: total_bw %lld, %lld\n", cpu, def, hk);
> + goto out;
> + }
> + if (write(fd[1], "x", 1) != 1) {
> + ksft_print_msg("write to the deadline task: %s\n", strerror(errno));
> + goto out;
> + }
> + t = now_ns();
> + if (wait_for(1000, proc_state_of(pid) == 'Z'))
> + goto out;
> + if (now_ns() - t > 500 * NSEC_PER_MSEC) {
> + ksft_print_msg("the task took over 500ms to exit\n");
> + ret = KSFT_SKIP;
> + goto out;
> + }
> + sleep_ns(10 * NSEC_PER_MSEC); /* past do_task_dead() */
> + err = cpu_online(fb_h, 0);
> + if (err) {
> + ksft_print_msg("offline of CPU %d under a dead task: %s\n", fb_h,
> + strerror(-err));
> + goto out;
> + }
> + reap(pid);
> + pid = -1;
> + cpu_up(fb_h);
> + sleep_ns(NSEC_PER_SEC); /* past the 0-lag time */
> + ret = totals_check("task gone", fb_i2, fb_h, def0, hk0);
> +out:
> + reap(pid);
> + cpu_up(fb_h);
> + if (fd[0] >= 0) {
> + close(fd[0]);
> + close(fd[1]);
> + }
> + cs_cleanup();
> + return ret;
> +}
[Severity: Low]
Does jumping to out after the 1-second-period deadline task has run (such
as on the 500ms exit-time KSFT_SKIP path or if cpu_online() fails) return
before the task's 0-lag time expires?
Because hp_cases[] run sequentially without rebuilding root domain
accounting, the dead task's bandwidth remains in the housekeeping root
domain's total_bw when the next test case reads its initial baseline hk0,
causing a false failure once the 0-lag timer fires during that test.
Moving sleep_ns(NSEC_PER_SEC) after reap(pid) and cpu_up(fb_h) in the out
block would wait out the 0-lag time on skip and error paths as well.
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1795116790.git.mathieu.desnoyers@efficios.com?part=18
next prev parent reply other threads:[~2026-11-19 20:27 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 20:15 [PATCH v8 00/33] sched/deadline: bandwidth accounting fixes and selftests Mathieu Desnoyers
2026-11-19 20:15 ` [PATCH v8 01/33] sched/deadline: Keep departing bandwidth across a root domain rebuild Mathieu Desnoyers
2026-11-19 20:15 ` [PATCH v8 02/33] sched/deadline: Rebuild the root domains' accounting from the task list Mathieu Desnoyers
2026-11-19 20:15 ` [PATCH v8 03/33] sched/deadline: Record the root domain holding a task's bandwidth Mathieu Desnoyers
2026-11-19 20:51 ` sashiko-bot
2026-11-19 20:15 ` [PATCH v8 04/33] sched/deadline: Leave a dying task out of a rebuild of the accounting Mathieu Desnoyers
2026-11-19 20:15 ` [PATCH v8 05/33] selftests/sched: Test SCHED_DEADLINE bandwidth across a root domain rebuild Mathieu Desnoyers
2026-11-19 20:28 ` sashiko-bot
2026-11-19 20:15 ` [PATCH v8 06/33] selftests/sched: Test the root domain rebuild in deadline_bw_test Mathieu Desnoyers
2026-11-19 20:15 ` [PATCH v8 07/33] sched/deadline: Move a task's bandwidth only where room was made Mathieu Desnoyers
2026-11-19 20:15 ` [PATCH v8 08/33] cgroup/cpuset: Wait for an attach before rebuilding the sched domains Mathieu Desnoyers
2026-11-19 20:15 ` [PATCH v8 09/33] sched: Make deadline policy and affinity changes wait for a cpuset attach Mathieu Desnoyers
2026-11-19 20:15 ` [PATCH v8 10/33] cgroup/cpuset: Give back the bandwidth an attach did not move Mathieu Desnoyers
2026-11-19 20:15 ` [PATCH v8 11/33] cgroup/cpuset: Reserve the bandwidth in the root domain a task moves to Mathieu Desnoyers
2026-11-19 20:15 ` [PATCH v8 12/33] selftests/sched: Test cpuset moves in deadline_bw_test Mathieu Desnoyers
2026-11-19 20:15 ` [PATCH v8 13/33] sched/deadline: Make a rebuild count a task in the root domain it runs in Mathieu Desnoyers
2026-11-19 20:15 ` [PATCH v8 14/33] sched/deadline: Move a task's bandwidth to " Mathieu Desnoyers
2026-11-19 20:53 ` sashiko-bot
2026-11-19 20:15 ` [PATCH v8 15/33] sched/deadline: Keep a task in the root domain that counts its bandwidth Mathieu Desnoyers
2026-11-19 20:55 ` sashiko-bot
2026-11-19 20:15 ` [PATCH v8 16/33] sched/deadline: Keep the last CPU a task has in its root domain Mathieu Desnoyers
2026-11-19 20:22 ` Mathieu Desnoyers
2026-11-19 20:48 ` sashiko-bot
2026-11-19 20:15 ` [PATCH v8 17/33] cgroup/cpuset: Refuse to take a deadline task out of " Mathieu Desnoyers
2026-11-19 20:43 ` sashiko-bot
2026-11-19 20:15 ` [PATCH v8 18/33] selftests/sched: Test the root domain of a task in deadline_bw_test Mathieu Desnoyers
2026-11-19 20:27 ` sashiko-bot [this message]
2026-11-19 20:15 ` [PATCH v8 19/33] sched/deadline: Count only active CPUs when spreading extra_bw Mathieu Desnoyers
2026-11-19 20:15 ` [PATCH v8 20/33] rtmutex: Continue the chain walk when a waiter's deadline donor changes Mathieu Desnoyers
2026-11-19 20:16 ` [PATCH v8 21/33] rtmutex: Continue the walk when the owner's top waiter changes lock Mathieu Desnoyers
2026-11-19 20:16 ` [PATCH v8 22/33] selftests/sched: Test the rtmutex chain walk in deadline_bw_test Mathieu Desnoyers
2026-11-19 20:16 ` [PATCH v8 23/33] sched/deadline: Reset the donor's runtime at a deboost in the class Mathieu Desnoyers
2026-11-19 20:53 ` sashiko-bot
2026-11-19 20:16 ` [PATCH v8 24/33] sched/deadline: Replenish a throttled task boosted while asleep Mathieu Desnoyers
2026-11-19 20:16 ` [PATCH v8 25/33] sched/deadline: Count the bandwidth a boosted task is given Mathieu Desnoyers
2026-11-19 20:16 ` [PATCH v8 26/33] sched/deadline: Start a period for a task that enters the class blocked Mathieu Desnoyers
2026-11-19 20:57 ` sashiko-bot
2026-11-19 20:16 ` [PATCH v8 27/33] sched/deadline: Start a period at a deboost out of the class Mathieu Desnoyers
2026-11-19 20:47 ` sashiko-bot
2026-11-19 20:16 ` [PATCH v8 28/33] selftests/sched: Test deadline boosts in deadline_bw_test Mathieu Desnoyers
2026-11-19 20:16 ` [PATCH v8 29/33] sched/deadline: Cancel the replenishment timer with the parameters Mathieu Desnoyers
2026-11-19 20:16 ` [PATCH v8 30/33] sched/deadline: Cap the runtime left of a constrained task at dl_runtime Mathieu Desnoyers
2026-11-19 20:16 ` [PATCH v8 31/33] sched/deadline: Check the runtime of a task that comes back runnable Mathieu Desnoyers
2026-11-19 20:16 ` [PATCH v8 32/33] sched/deadline: Check the runtime of a task whose parameters change Mathieu Desnoyers
2026-11-19 20:59 ` sashiko-bot
2026-11-19 20:16 ` [PATCH v8 33/33] selftests/sched: Test parameter changes in deadline_bw_test Mathieu Desnoyers
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=sashiko-outbox-224019@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-devel@lists.linux.dev \
--cc=mathieu.desnoyers@efficios.com \
--cc=mkoutny@suse.com \
--cc=sashiko-reviews@lists.linux.dev \
--cc=tj@kernel.org \
/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®