Re: [PATCH v10 24/40] selftests/sched: Test the rtmutex chain walk in deadline_bw_test

From: sashiko-bot

Date: Fri Nov 20 2026 - 16:06:09 EST


Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] selftests/sched: top_moves() fails instead of skipping
without RT runtime
--

commit 6100a36909c549fb0079a550f7245c5c073ca05e
Author: Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx>

selftests/sched: Test the rtmutex chain walk in deadline_bw_test

This commit adds the pi_chain_top_moves and pi_chain_top_moves_rt test
cases to deadline_bw_test to verify rtmutex priority inheritance chain
walks when an owner's top waiter moves to another lock it holds.

> diff --git a/tools/testing/selftests/sched/deadline/deadline_bw_test.c b/tools/testing/selftests/sched/deadline/deadline_bw_test.c
> index 7b0a3f2fb12b8..cf3b49cf2be28 100644
> --- a/tools/testing/selftests/sched/deadline/deadline_bw_test.c
> +++ b/tools/testing/selftests/sched/deadline/deadline_bw_test.c
[ ... ]
> +/*
> + * W and Z: W blocks on L1', Z on L1. @arg is 1 for W. With top_rt, W
> + * becomes SCHED_FIFO 50 and Z SCHED_FIFO 20. Otherwise W becomes a
> + * deadline task of 2ms every 80ms and Z one of 5ms every 200ms. The main
> + * thread switches W to SCHED_OTHER while it waits.
> + */
> +static void *top_waiter(void *arg)
> +{
> + int w = (long)arg;
> + struct sched_param sp = { .sched_priority = w ? 50 : 20 };
> + uint64_t runtime = (w ? 2 : 5) * NSEC_PER_MSEC;
> + pthread_mutex_t *l = w ? &top_lock : &pi_lock;
> +
> + if (top_rt ? sched_setscheduler(0, SCHED_FIFO, &sp) :
> + set_deadline(0, runtime, 40 * runtime)) {
> + top_err = 1;
> + return arg;
> + }

[Severity: Medium]
Should top_moves() return KSFT_SKIP instead of KSFT_FAIL when
sched_setscheduler(0, SCHED_FIFO, &sp) fails with EPERM?

pi_chain_top_moves_rt runs with MEASURED_IN_P inside child cgroup P. When
CONFIG_RT_GROUP_SCHED is enabled and the cgroup v2 cpu controller is active
in the root cgroup, child cgroups have no RT runtime, so
sched_setscheduler() returns EPERM and sets top_err = 1, failing the test.
Other SCHED_FIFO tests in P check for EPERM and skip:

tools/testing/selftests/sched/deadline/deadline_bw_test.c:server_client() {
...
if (rt && sched_setscheduler(0, SCHED_FIFO, &sp)) {
/* With RT group scheduling, P can have no RT runtime. */
if (errno == EPERM)
mv_state[6] = 1;
_exit(1);
}
...
}

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