Re: [PATCH v12 18/43] selftests/sched: Test the root domain of a task in deadline_bw_test
From: sashiko-bot
Date: Fri Nov 27 2026 - 11:10:40 EST
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] selftests/sched: hotplug_user_mask_refused() fails when nisol >
2
--
commit 1feed7a3b20fcb7febc6347a6bcad087b2151e55
Author: Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx>
selftests/sched: Test the root domain of a task in deadline_bw_test
This commit adds 32 test cases to deadline_bw_test covering SCHED_DEADLINE
root domain bandwidth accounting across CPU hotplug, cpuset changes,
partition roots, and CPUs isolated with isolcpus=domain.
> diff --git a/tools/testing/selftests/sched/deadline/deadline_bw_test.c b/tools/testing/selftests/sched/deadline/deadline_bw_test.c
> index f50d45dd57994..87fa1a7d420fd 100644
> --- a/tools/testing/selftests/sched/deadline/deadline_bw_test.c
> +++ b/tools/testing/selftests/sched/deadline/deadline_bw_test.c
[ ... ]
> @@ -7048,100 +7599,1873 @@ static pid_t task_from(int cpu, int all, uint64_t runtime, uint64_t period, int
[ ... ]
> +static int hotplug_user_mask_refused(void)
> +{
> + int fd[2] = { -1, -1 }, err, cpu, ret = KSFT_SKIP;
> + long long def0, hk0, def, hk, bw;
> + char buf[64];
> + pid_t pid = -1;
> +
> + if (fallback_cpus(0) || !cpu_hotpluggable(fb_h)) {
> + ksft_print_msg("needs isolcpus=domain: 2 isolated, 2 housekeeping CPUs, hotplug\n");
> + return KSFT_SKIP;
> + }
> + if (cs_setup())
> + return KSFT_SKIP;
> + snprintf(buf, sizeof(buf), "%d,%d,%d,%d", fb_i1, fb_i2, fb_h, fb_k);
> + if (cs_make(cs_b, buf) || write_file(cs_b, "cgroup.subtree_control", "+cpuset"))
> + goto out;
> + snprintf(buf, sizeof(buf), "%d", fb_h);
> + if (cs_make(cs_c, buf) || fallback_totals(&def0, &hk0) || pipe(fd))
> + goto out;
> + ret = KSFT_FAIL;
> + mv_state[0] = 0;
> + mv_state[1] = 0;
> + pid = fork_child("a deadline task");
> + if (!pid) {
> + cpu_set_t set;
> + char c;
> +
> + CPU_ZERO(&set);
> + CPU_SET(fb_i1, &set);
> + CPU_SET(fb_i2, &set);
> + if (sched_setaffinity(0, sizeof(set), &set) ||
> + set_deadline(0, 10 * NSEC_PER_MSEC, PERIOD)) {
> + mv_state[0] = -1;
> + _exit(1);
> + }
[Severity: Low]
Will set_deadline() fail with EPERM here when more than two CPUs are
isolated with isolcpus=domain (nisol > 2)?
In the root cgroup, __sched_setscheduler() requires the task's affinity
mask to be a superset of def_root_domain.span, which contains all nisol
isolated CPUs rather than just fb_i1 and fb_i2. Adding all isol[0..nisol-1]
CPUs to set before set_deadline() (as spin_offline() does), and then
narrowing the mask to fb_i1, fb_i2 and fb_h afterwards, would allow the
test to pass when nisol > 2.
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1795771147.git.mathieu.desnoyers@xxxxxxxxxxxx?part=18