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 v3 17/17] selftests/sched: Add a test of SCHED_DEADLINE bandwidth accounting
Date: Thu, 19 Nov 2026 14:22:53 +0000 [thread overview]
Message-ID: <sashiko-outbox-223287@kernel.org> (raw)
In-Reply-To: <cbb59b2e6ec73b9c32cd43ef6ddc8548070a5942.1795092090.git.mathieu.desnoyers@efficios.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] selftests/sched: dead code and unused variables in
deadline_bw_test
--
commit 6221c4626318f0c62cd5eec65b1e903934d1d349
Author: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
selftests/sched: Add a test of SCHED_DEADLINE bandwidth accounting
This commit adds the deadline_bw_test kselftest to verify SCHED_DEADLINE
bandwidth accounting across priority inheritance, parameter changes,
cpuset moves, task deaths, deadline servers, and CPU hotplug.
Link: https://github.com/jlelli/sched-deadline-tests
> diff --git a/tools/testing/selftests/sched/deadline/deadline_bw_test.c b/tools/testing/selftests/sched/deadline/deadline_bw_test.c
> new file mode 100644
> index 0000000000000..f91eeddceba18
> --- /dev/null
> +++ b/tools/testing/selftests/sched/deadline/deadline_bw_test.c
[ ... ]
> +/* The same, for a task that leaves and comes back while it sleeps. */
> +static int return_asleep_new_params(void)
> +{
> + return return_case(1);
> +}
> +
> +static pthread_mutex_t pi_lock2;
> +static sem_t holder_go;
> +static atomic_int holder_holds, chain_waits, donor_done, x_waits, l2_takes;
> +static atomic_int chain_rank, x_rank;
> +static _Atomic pid_t x_tid, fair_tid;
[ ... ]
> + ncpus = read_online(&online, 0);
> + nisol = read_online(&isol, 1);
> + if (ncpus < 0 || nisol < 0)
> + ksft_exit_fail_msg("the online CPUs cannot be read\n");
[Severity: Low]
Several test modes and static variables in deadline_bw_test.c are never
used:
- return_case() and returner() implement modes 0 through 5 (including
calls to set_constrained() in modes 4 and 5), but return_case() is only
called with mode 1 in return_asleep_new_params().
- deboost_case() and deboosted_owner() implement modes 1 and 2, but
deboost_case() is only called with mode 0 in deboost_resets_period().
- refill_case() checks for spin_ms == 8, but is only called with 1 in
deboost_keeps_own_runtime().
- pi_asleep() and sleeping_owner() implement was_dl != 0 branches, but all
callers pass 0.
- fair_tid is only assigned 0 in pi_init_lock2(), sleeper_cpu stays at -1
(making the sleeper_cpu >= 0 block in dl_sleeper_tid() unreachable), and
isol and nisol are populated in main() via read_online(&isol, 1) and
never used or freed.
- MV_YIELDED in mover(), struct hp_case::no_hp, and the forward
declarations of wait_spinner(), hold(), and release_held() are unused.
Were these extra modes meant to be wired into p_cases[], or should the
unused code be dropped?
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1795092090.git.mathieu.desnoyers@efficios.com?part=17
prev parent reply other threads:[~2026-11-19 14:22 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 13:49 [PATCH v3 00/17] sched/deadline: first bandwidth accounting fixes and selftests Mathieu Desnoyers
2026-11-19 13:49 ` [PATCH v3 01/17] sched: Refuse SCHED_FLAG_KEEP_PARAMS that would change the policy or the class Mathieu Desnoyers
2026-11-19 13:49 ` [PATCH v3 02/17] sched/deadline: Do not admit bandwidth for parameters that are kept Mathieu Desnoyers
2026-11-19 13:49 ` [PATCH v3 03/17] sched: Let a task boosted by a deadline waiter change its policy Mathieu Desnoyers
2026-11-19 13:49 ` [PATCH v3 04/17] sched/deadline: Do not divide by zero active CPUs of a root domain Mathieu Desnoyers
2026-11-19 14:08 ` sashiko-bot
2026-11-19 13:49 ` [PATCH v3 05/17] sched/deadline: Refuse dl_server debugfs writes while the rq is offline Mathieu Desnoyers
2026-11-19 13:49 ` [PATCH v3 06/17] sched: Take cpuset_mutex for a deadline policy change only with pi Mathieu Desnoyers
2026-11-19 13:49 ` [PATCH v3 07/17] sched/deadline: Do not lose a throttled task switched out and back Mathieu Desnoyers
2026-11-19 13:49 ` [PATCH v3 08/17] sched/deadline: Do not replenish a boost from cleared parameters Mathieu Desnoyers
2026-11-19 13:49 ` [PATCH v3 09/17] sched/deadline: Reset the deadline and the runtime with the parameters Mathieu Desnoyers
2026-11-19 14:17 ` sashiko-bot
2026-11-19 13:49 ` [PATCH v3 10/17] sched/deadline: Fix an overflow of the 0-lag time with long periods Mathieu Desnoyers
2026-11-19 14:07 ` sashiko-bot
2026-11-19 13:49 ` [PATCH v3 11/17] sched/deadline: Release the bandwidth of a task that leaves the class asleep Mathieu Desnoyers
2026-11-19 13:49 ` [PATCH v3 12/17] sched/deadline: Reject SCHED_DEADLINE on exited tasks Mathieu Desnoyers
2026-11-19 13:49 ` [PATCH v3 13/17] sched/deadline: Fix this_bw when a task is changed during a remote wakeup Mathieu Desnoyers
2026-11-19 13:49 ` [PATCH v3 14/17] sched/deadline: Check SCHED_DEADLINE affinity under the rq lock Mathieu Desnoyers
2026-11-19 13:49 ` [PATCH v3 15/17] sched/debug: Show the deadline bandwidth of each runqueue Mathieu Desnoyers
2026-11-19 13:49 ` [PATCH v3 16/17] selftests/sched: Add a test of SCHED_DEADLINE policy round trips Mathieu Desnoyers
2026-11-19 13:49 ` [PATCH v3 17/17] selftests/sched: Add a test of SCHED_DEADLINE bandwidth accounting Mathieu Desnoyers
2026-11-19 14:22 ` sashiko-bot [this message]
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-223287@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