Re: [PATCH v10 18/40] selftests/sched: Test the root domain of a task in deadline_bw_test

From: sashiko-bot

Date: Fri Nov 20 2026 - 15:54:13 EST


Thank you for your contribution! Sashiko AI review found 3 potential
issues to consider:
- [Low] selftests/sched: missing no_hp flag for
partition_grows_child_valid()
- [Low] selftests/sched: inverted tell flag in
partition_grows_child_valid()
- [Low] selftests/sched: missing cpu_hotpluggable() check in
hotplug_top_last_refused()
--

commit 31c2701ec79ac71f9d7072a6b7c9ae3a844ce21e
Author: Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx>

selftests/sched: Test the root domain of a task in deadline_bw_test

This commit adds 28 test cases to deadline_bw_test covering root domain
bandwidth accounting across CPU hotplug, cpuset partition changes, and
isolated CPUs.

> diff --git a/tools/testing/selftests/sched/deadline/deadline_bw_test.c b/tools/testing/selftests/sched/deadline/deadline_bw_test.c
> index 0b53b64c7b3a2..7b0a3f2fb12b8 100644
> --- a/tools/testing/selftests/sched/deadline/deadline_bw_test.c
> +++ b/tools/testing/selftests/sched/deadline/deadline_bw_test.c

[ ... ]

> @@ -7144,6 +7695,1779 @@ static int move_back_cpu_offline(void)

[ ... ]

> +static int partition_grows_child_valid(void)
> +{

[ ... ]

> + snprintf(buf, sizeof(buf), "%d,%d", a, b);
> + err = write_file(cs_b, "cpuset.cpus", buf);
> + if (err) {
> + ksft_print_msg("B cannot get CPUs %s: %s\n", buf, strerror(-err));
> + goto out;
> + }
> + if (!partition_has(cs_c, "root", 1) || partition_has(cs_c, "invalid", 1))
> + goto out;

[Severity: Low]
Should the second call pass 0 for tell: partition_has(cs_c, "invalid", 0)?

partition_has() prints cpuset.cpus.partition when the substring is absent
and tell is non-zero. Passing 1 here logs a message on every passing run
when "invalid" is absent, and stays silent when cs_c fails by remaining
"root invalid (...)".

[ ... ]

> +static int hotplug_top_last_refused(void)
> +{
> + int i, n = 0, err, ret = KSFT_SKIP, x = top_cpu(1), x_off = 0;
> + char buf[256], cpus[1024], path[PATH_MAX + 32];
> + int go[2] = { -1, -1 }, ack[2] = { -1, -1 };
> + pid_t pid = -1;
> + cpu_set_t all;
> + char c;
> +
> + if (ncpus < 3 || cs_setup())
> + return KSFT_SKIP;

[Severity: Low]
Should this also skip when !cpu_hotpluggable(x)?

main() sets hp_cpu if any housekeeping CPU can go offline, which does not
guarantee that top_cpu(1) specifically is hotpluggable. If top_cpu(1)
cannot go offline while another housekeeping CPU can, cpu_online(x, 0)
later in this test fails instead of skipping.

[ ... ]

> @@ -7960,8 +10284,36 @@ static const struct hp_case {

[ ... ]

> + { "hotplug_sibling_partition_refused", hotplug_sibling_partition_refused },
> + { "hotplug_top_last_refused", hotplug_top_last_refused },
> + { "partition_grows_child_valid", partition_grows_child_valid },
> + { "hotplug_isolated_partition_falls_back", hotplug_isolated_partition_falls_back },
> + { "partition_takes_fallback_refused", partition_takes_fallback_refused, 1 },

[Severity: Low]
Should the partition_grows_child_valid entry set no_hp to 1?

partition_grows_child_valid() does not take any CPU offline and the file
header lists it among the ten cases in hp_cases[] that still run when no
CPU can go offline, but without the trailing 1 initializer main() skips it
whenever hp_cpu < 0.

--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1795207232.git.mathieu.desnoyers@xxxxxxxxxxxx?part=18