From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: juri.lelli@redhat.com, peterz@infradead.org, mingo@redhat.com,
vincent.guittot@linaro.org
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
tglx@kernel.org, will@kernel.org, boqun@kernel.org,
dietmar.eggemann@arm.com, rostedt@goodmis.org,
bsegall@google.com, mgorman@suse.de, vschneid@redhat.com,
kprateek.nayak@amd.com, luca.abeni@santannapisa.it,
tommaso.cucinotta@gmail.com, mathieu.poirier@linaro.org,
longman@redhat.com, ridong.chen@linux.dev, tj@kernel.org,
hannes@cmpxchg.org, mkoutny@suse.com, shuah@kernel.org,
bigeasy@linutronix.de, clrkwllms@kernel.org,
parri.andrea@gmail.com, m.szyprowski@samsung.com,
kayracizmeci@gmail.com, weihengqiuu@gmail.com,
linux-kernel@vger.kernel.org, cgroups@vger.kernel.org,
linux-kselftest@vger.kernel.org, linux-rt-devel@lists.linux.dev,
oleg@redhat.com, brauner@kernel.org
Subject: [PATCH v13 35/36] selftests/sched: Test PI against hotplug and rebuilds in deadline_bw_test
Date: Tue, 1 Dec 2026 12:44:29 -0500 [thread overview]
Message-ID: <e61bc31fa01c8c19e29db0067c9d4a9882fdbd54.1796146461.git.mathieu.desnoyers@efficios.com> (raw)
In-Reply-To: <cover.1796146461.git.mathieu.desnoyers@efficios.com>
Add two cases to deadline_bw_test. The comment above each case gives
its scenario. Each case fails without one fix of this series:
- pi_departed_offline_boost. A task leaves SCHED_DEADLINE while its
root domain still counts its bandwidth. Then the CPU recorded with
that bandwidth goes offline. The rebuild of the accounting that
follows drops the bandwidth. A deadline waiter then boosts the task
back into the class. The case checks that total_bw counts the task
again. The fix is "sched/deadline: Count again a departed task that
a boost brings back". Without it, the case failed in every run.
- pi_deboost_during_rebuild. The timeout of a deadline waiter deboosts
a task while a rebuild of the accounting walks the task list. The
case checks that total_bw still counts the task right after the
rebuild. The fix is "sched/deadline: Count a task that departs while
a rebuild walks the tasks".
pi_deboost_during_rebuild tests a race. It runs rounds for 25s, and
fails at the first round where total_bw misses the task. A filler
process of 1000 threads is forked before the task. The walk meets
these threads first, so the race window is wider. Without the fix, 35
of 43 runs failed.
pi_departed_offline_boost needs 4 housekeeping CPUs, two of them
hotpluggable. pi_deboost_during_rebuild needs 5. Each case skips
without them.
With the whole series, both cases pass in every run. No kernel warning
is logged.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
---
.../sched/deadline/deadline_bw_test.c | 487 +++++++++++++++++-
1 file changed, 481 insertions(+), 6 deletions(-)
diff --git a/tools/testing/selftests/sched/deadline/deadline_bw_test.c b/tools/testing/selftests/sched/deadline/deadline_bw_test.c
index bca333d5498c..e68d9437580f 100644
--- a/tools/testing/selftests/sched/deadline/deadline_bw_test.c
+++ b/tools/testing/selftests/sched/deadline/deadline_bw_test.c
@@ -40,15 +40,16 @@
* hotplug cases, and the cases with no_hp set, which take no CPU
* offline. The test skips the hotplug cases if no CPU can go offline. It
* still runs the no_hp ones.
- * death_zombie_hotplug takes CPUs offline too, but it is in p_cases[]: it
- * needs the cpuset setup of those cases.
+ * death_zombie_hotplug and pi_departed_offline_boost take CPUs offline
+ * too, but they are in p_cases[]: they need the cpuset setup of those
+ * cases.
*
* The server cases change the fair server of a CPU through debugfs, and
* the test then puts it back.
*
* The test needs root, deadline admission control and 3 housekeeping
- * CPUs. Some cases need 4. Most also need the cgroup v2 cpuset
- * controller. Some need debugfs or CPU hotplug. Twenty-nine need
+ * CPUs. Some cases need 4, one needs 5. Most also need the cgroup v2
+ * cpuset controller. Some need debugfs or CPU hotplug. Twenty-nine need
* isolcpus="domain" at boot.
*/
#define _GNU_SOURCE
@@ -8338,8 +8339,9 @@ static int random_mix(void)
}
/*
- * CPU hotplug, from the main process, with no P. Two cases below run with
- * P instead: death_zombie_hotplug and pi_departed_moved.
+ * CPU hotplug, from the main process, with no P. Three cases below run
+ * with P instead: death_zombie_hotplug, pi_departed_moved and
+ * pi_departed_offline_boost.
*/
static int hp_cpu = -1;
@@ -8928,6 +8930,163 @@ static int pi_departed_moved(void)
return ret;
}
+/*
+ * Q is a partition root of CPUs X and Y. The owner is a deadline task of
+ * 200ms every 2s in Q. The steps:
+ * 1. The owner takes shm_lock, runs 180ms and sleeps on X. Its 0-lag
+ * time is about 1.6s ahead.
+ * 2. The case switches the owner to SCHED_OTHER. The root domain of Q
+ * keeps its bandwidth until the 0-lag time. The kernel records X with
+ * that bandwidth.
+ * 3. The case pins the owner to Y and wakes it up. It runs on Y, then
+ * sleeps there. The record stays X.
+ * 4. The case takes X offline, which rebuilds the accounting. The
+ * recorded CPU is no longer active, so the rebuild drops the
+ * bandwidth of the owner.
+ * 5. A deadline waiter of 5ms every 50ms, outside Q, blocks on shm_lock.
+ * It boosts the owner back into the class.
+ *
+ * The boost must add the bandwidth of the owner to this_bw of Y, and to
+ * total_bw of Q. Once the owner and the waiter are gone, past the 0-lag
+ * time, total_bw of Q must be what it was at the start.
+ */
+static int pi_departed_offline_boost(void)
+{
+ int cpu[2] = { top_cpu(3), top_cpu(2) }, x, y, ret = KSFT_FAIL;
+ long long base, bw, off, boosted;
+ long this0, this1, running;
+ pid_t owner = -1, waiter = -1;
+ char cpus[32];
+ cpu_set_t set;
+ uint64_t t;
+
+ if (ncpus < 4 || !cpu_hotpluggable(cpu[0]) || !cpu_hotpluggable(cpu[1])) {
+ ksft_print_msg("needs 4 non-isolated CPUs, 2 hotpluggable beside P\n");
+ return KSFT_SKIP;
+ }
+ snprintf(cpus, sizeof(cpus), "%d,%d", cpu[0], cpu[1]);
+ if (make_partition_cpus(cg_q, cpus)) {
+ ksft_print_msg("no partition root Q of CPUs %s\n", cpus);
+ remove_partition(cg_q);
+ return KSFT_SKIP;
+ }
+ base = total_bw_of(cpu[0]);
+ if (base < 0 || rq_bw_of(cpu[0], &this0, &running)) {
+ ksft_print_msg("no total_bw or this_bw in /sys/kernel/debug/sched/debug\n");
+ remove_partition(cg_q);
+ return KSFT_SKIP;
+ }
+ if (shm_lock_init()) {
+ remove_partition(cg_q);
+ return KSFT_SKIP;
+ }
+ bw = (ZOMBIE_RUNTIME << 20) / ZOMBIE_PERIOD; /* as to_ratio() */
+ mv_state[1] = 0;
+ mv_state[3] = 0;
+ owner = fork_child("the owner of the lock");
+ if (!owner) {
+ signal(SIGUSR1, no_op);
+ if (enter(cg_q, getpid()) || pthread_mutex_lock(shm_lock) ||
+ set_deadline(0, ZOMBIE_RUNTIME, ZOMBIE_PERIOD)) {
+ mv_state[0] = -1;
+ _exit(1);
+ }
+ /* 20ms left: the 0-lag time is 200ms before the deadline. */
+ spin_ns(ZOMBIE_RUNTIME - 20 * NSEC_PER_MSEC);
+ mv_state[0] = 1;
+ while (!mv_state[3])
+ pause();
+ mv_state[1] = 1;
+ for (;;)
+ pause();
+ }
+ if (owner < 0 || child_up("the owner of the lock", 0))
+ goto out;
+ t = now_ns();
+ if (wait_for(100, proc_state_of(owner) == 'S')) {
+ ksft_print_msg("the owner is not asleep\n");
+ goto out;
+ }
+ /* Step 2. Asleep, the owner departs from the CPU it sleeps on. */
+ if (set_other(owner)) {
+ ksft_print_msg("the owner cannot leave SCHED_DEADLINE\n");
+ goto out;
+ }
+ x = task_cpu_of(owner);
+ if (x != cpu[0] && x != cpu[1]) {
+ ksft_print_msg("the owner sleeps on CPU %d, not in Q\n", x);
+ goto out;
+ }
+ y = x == cpu[0] ? cpu[1] : cpu[0];
+ /* Step 3 */
+ CPU_ZERO(&set);
+ CPU_SET(y, &set);
+ if (sched_setaffinity(owner, sizeof(set), &set)) {
+ ksft_print_msg("the owner cannot be pinned to CPU %d: %s\n", y, strerror(errno));
+ goto out;
+ }
+ mv_state[3] = 1;
+ kill(owner, SIGUSR1);
+ if (wait_state(&mv_state[1], 1) || wait_for(500, proc_state_of(owner) == 'S') ||
+ task_cpu_of(owner) != y) {
+ ksft_print_msg("the owner did not move to CPU %d\n", y);
+ goto out;
+ }
+ /* Step 4 */
+ if (cpu_online(x, 0)) {
+ ksft_print_msg("CPU %d cannot go offline\n", x);
+ goto out;
+ }
+ off = total_bw_of(y);
+ if (rq_bw_of(y, &this0, &running)) {
+ ksft_print_msg("no this_bw of CPU %d\n", y);
+ goto online;
+ }
+ /* Step 5 */
+ waiter = lock_waiter();
+ if (waiter < 0 || wait_state(&mv_state[2], 1)) {
+ ksft_print_msg("no waiter\n");
+ goto online;
+ }
+ sleep_ns(50 * NSEC_PER_MSEC); /* blocked, boosting the owner */
+ if (prio_of(owner) != DL_TASK_PRIO) {
+ ksft_print_msg("the owner is not boosted: prio %d\n", prio_of(owner));
+ goto online;
+ }
+ boosted = total_bw_of(y);
+ if (rq_bw_of(y, &this1, &running)) {
+ ksft_print_msg("no this_bw of CPU %d\n", y);
+ } else if (now_ns() - t > NSEC_PER_SEC) {
+ ksft_print_msg("the steps took over 1s: the 0-lag time may be past\n");
+ ret = KSFT_SKIP;
+ } else if (this1 - this0 != bw) {
+ ksft_print_msg("the boost adds %ld to this_bw of CPU %d, %lld expected\n",
+ this1 - this0, y, bw);
+ } else if (boosted != off + bw) {
+ ksft_print_msg("total_bw of Q: %lld boosted, %lld expected%s\n",
+ boosted, off + bw,
+ boosted == off ? ": the owner is not counted" : "");
+ } else {
+ ret = KSFT_PASS;
+ }
+online:
+ reap(waiter);
+ cpu_up(x);
+out:
+ reap(owner);
+ if (ret == KSFT_PASS) {
+ sleep_ns(ZOMBIE_PERIOD); /* past the 0-lag time of the owner */
+ off = total_bw_of(cpu[0]);
+ if (off != base) {
+ ksft_print_msg("total_bw of Q past the 0-lag time: %lld, %lld expected\n",
+ off, base);
+ ret = KSFT_FAIL;
+ }
+ }
+ remove_partition(cg_q);
+ return ret;
+}
+
/*
* The bandwidth of a fair server must leave the root domain with its CPU
* and come back with it, whatever its size. Probe the housekeeping root
@@ -12596,6 +12755,320 @@ static int affinity_vs_setattr(void)
return ret;
}
+/* A deboost against a rebuild of the accounting */
+
+#define RACE_T_RUNTIME (20 * NSEC_PER_MSEC)
+#define RACE_T_PERIOD (200 * NSEC_PER_MSEC)
+#define RACE_W_RUNTIME (5 * NSEC_PER_MSEC)
+#define RACE_W_PERIOD (50 * NSEC_PER_MSEC)
+#define RACE_FILLERS 1000
+#define RACE_SECS 25
+
+/*
+ * The state that pi_deboost_during_rebuild() shares with its processes,
+ * in shared memory. T and W are the threads that its comment describes.
+ * go and w_go count the rounds of T and W. t_ready and w_done tell the
+ * case that a round of T or of W is done.
+ */
+static struct race_shm {
+ atomic_int go, t_ready, w_go, w_blocked, w_done, w_err, fill;
+ _Atomic pid_t t_tid, w_tid;
+ _Atomic int64_t w_abs, w_ret;
+} *rs;
+
+/* The priority inheritance mutex of T and W, threads of one process */
+static pthread_mutex_t race_m;
+
+static int64_t realtime_ns(void)
+{
+ struct timespec ts;
+
+ clock_gettime(CLOCK_REALTIME, &ts);
+ return (int64_t)ts.tv_sec * NSEC_PER_SEC + ts.tv_nsec;
+}
+
+/* Wait for the futex @f, in shared memory, to change from @val. */
+static void wait_change(atomic_int *f, int val)
+{
+ while (*f == val)
+ syscall(SYS_futex, f, FUTEX_WAIT, val, NULL, NULL, 0);
+}
+
+static void *race_filler(void *arg)
+{
+ for (;;)
+ pause();
+ return arg;
+}
+
+/*
+ * W: become a deadline task. In each round, block on race_m until the
+ * time rs->w_abs, CLOCK_REALTIME. The wait must time out: T holds
+ * race_m.
+ */
+static void *race_w(void *arg)
+{
+ int i = 0;
+
+ rs->w_tid = gettid_();
+ if (set_deadline(0, RACE_W_RUNTIME, RACE_W_PERIOD)) {
+ set_flag(&rs->w_err, -1);
+ return arg;
+ }
+ for (;;) {
+ struct timespec ts;
+ int err;
+
+ wait_change(&rs->w_go, i);
+ i = rs->w_go;
+ if (i < 0)
+ return arg;
+ ts.tv_sec = rs->w_abs / NSEC_PER_SEC;
+ ts.tv_nsec = rs->w_abs % NSEC_PER_SEC;
+ rs->w_blocked = i;
+ err = pthread_mutex_timedlock(&race_m, &ts);
+ rs->w_ret = realtime_ns();
+ if (!err) {
+ pthread_mutex_unlock(&race_m);
+ rs->w_err = 1;
+ } else if (err != ETIMEDOUT) {
+ rs->w_err = 2;
+ }
+ set_flag(&rs->w_done, i);
+ }
+}
+
+/*
+ * Fork the process of T and W, in the cgroup @cg. T, its main thread,
+ * takes race_m and starts W. In each round, T makes itself a deadline
+ * task, runs most of its runtime and sleeps. Return the pid, or -1.
+ */
+static pid_t race_t(const char *cg)
+{
+ pid_t pid = fork_child("T and W");
+
+ if (!pid) {
+ pthread_mutexattr_t a;
+ pthread_t w;
+ int i = 0;
+
+ if (enter(cg, getpid()) || pthread_mutexattr_init(&a) ||
+ pthread_mutexattr_setprotocol(&a, PTHREAD_PRIO_INHERIT) ||
+ pthread_mutex_init(&race_m, &a) || pthread_mutex_lock(&race_m) ||
+ pthread_create(&w, NULL, race_w, NULL)) {
+ set_flag(&rs->w_err, -1);
+ _exit(1);
+ }
+ rs->t_tid = gettid_();
+ for (;;) {
+ wait_change(&rs->go, i);
+ i = rs->go;
+ if (i < 0)
+ _exit(0);
+ if (set_deadline(0, RACE_T_RUNTIME, RACE_T_PERIOD)) {
+ set_flag(&rs->t_ready, -i);
+ continue;
+ }
+ /* 2ms left: the 0-lag time is 20ms before the deadline. */
+ spin_ns(RACE_T_RUNTIME - 2 * NSEC_PER_MSEC);
+ set_flag(&rs->t_ready, i);
+ }
+ }
+ return pid;
+}
+
+/*
+ * Fork a process of RACE_FILLERS threads that sleep. Return its pid, or
+ * -1. It sets rs->fill to the count of threads it made, or to -1.
+ */
+static pid_t race_fill(void)
+{
+ pid_t pid = fork_child("the filler");
+
+ if (!pid) {
+ pthread_attr_t at;
+ pthread_t t;
+ int n;
+
+ pthread_attr_init(&at);
+ pthread_attr_setstacksize(&at, THREAD_STACK);
+ for (n = 0; n < RACE_FILLERS; n++) {
+ if (pthread_create(&t, &at, race_filler, NULL))
+ break;
+ }
+ set_flag(&rs->fill, n ? n : -1);
+ for (;;)
+ pause();
+ }
+ return pid;
+}
+
+/* Toggle Q between a partition root and a member. Return 0, or -errno. */
+static int toggle_q(int *q_root)
+{
+ *q_root = !*q_root;
+ return write_file(cg_q, "cpuset.cpus.partition", *q_root ? "root" : "member");
+}
+
+/*
+ * A rebuild of the accounting clears the bandwidth of the root domains,
+ * then walks the task list and adds back each deadline task. A task can
+ * leave the class in the window between the clear and the walk reaching
+ * it. It must still be counted until its 0-lag time.
+ *
+ * R is a partition root of two CPUs. Q is a partition root of one CPU. T
+ * and W are threads of one process in R. T holds race_m, a priority
+ * inheritance mutex. Before T and W, the case forks a filler process of
+ * RACE_FILLERS threads that sleep. The walk meets them before T, which
+ * makes the window wider. In each round:
+ * 1. T makes itself a deadline task of 20ms every 200ms. It runs 18ms
+ * and sleeps. Its 0-lag time is about 160ms ahead.
+ * 2. W, a deadline task of 5ms every 50ms, blocks on race_m with a
+ * timeout. It boosts T.
+ * 3. The case switches T to SCHED_OTHER. The boost keeps T in the class.
+ * 4. The case switches Q between member and partition root. This
+ * rebuilds the accounting. The case times the write so that the
+ * timeout of W falls in it, at a random point. The timeout ends the
+ * boost: T leaves the class before its 0-lag time.
+ * 5. Right after, total_bw of R must count W and T.
+ * 6. Past the 0-lag time of T, total_bw of R must count W only.
+ *
+ * The rounds run for RACE_SECS seconds. The case fails at the first
+ * round where total_bw of R misses T.
+ */
+static int pi_deboost_during_rebuild(void)
+{
+ int cpu[2] = { top_cpu(4), top_cpu(3) }, q_root = 1, ret = KSFT_FAIL, i;
+ long long base, bw_t, bw_w, tb;
+ char cg_r[PATH_MAX + 32], cpus[32];
+ pid_t filler = -1, proc = -1;
+ uint64_t end, d, dmax = 0;
+
+ if (ncpus < 5) {
+ ksft_print_msg("needs 5 non-isolated CPUs\n");
+ return KSFT_SKIP;
+ }
+ snprintf(cg_r, sizeof(cg_r), "%s/deadline_bw_r", root);
+ snprintf(cpus, sizeof(cpus), "%d,%d", cpu[0], cpu[1]);
+ if (make_partition_cpus(cg_r, cpus) || make_partition(cg_q, top_cpu(2))) {
+ ksft_print_msg("no partition roots R of CPUs %s and Q of CPU %d\n",
+ cpus, top_cpu(2));
+ ret = KSFT_SKIP;
+ goto out_cg;
+ }
+ rs = mmap(NULL, sizeof(*rs), PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANONYMOUS, -1, 0);
+ if (rs == MAP_FAILED) {
+ ksft_print_msg("mmap: %s\n", strerror(errno));
+ goto out_cg;
+ }
+ memset(rs, 0, sizeof(*rs));
+ bw_t = bw_of(RACE_T_RUNTIME, RACE_T_PERIOD);
+ bw_w = bw_of(RACE_W_RUNTIME, RACE_W_PERIOD);
+
+ filler = race_fill();
+ if (filler < 0 || wait_for(10000, rs->fill) || rs->fill < 0) {
+ ksft_print_msg("no filler threads\n");
+ goto out;
+ }
+ /* The longest of 8 writes to Q sets the range of the timeouts. */
+ for (i = 0; i < 8; i++) {
+ uint64_t t = now_ns();
+
+ if (toggle_q(&q_root)) {
+ ksft_print_msg("Q cannot change between root and member\n");
+ ret = KSFT_SKIP;
+ goto out;
+ }
+ d = now_ns() - t;
+ if (d > dmax)
+ dmax = d;
+ }
+ if (total_bw_of(cpu[0]) < 0) {
+ ksft_print_msg("no total_bw in /sys/kernel/debug/sched/debug\n");
+ ret = KSFT_SKIP;
+ goto out;
+ }
+ proc = race_t(cg_r);
+ if (proc < 0 || wait_for(2000, (rs->w_tid && rs->t_tid) || rs->w_err) || rs->w_err) {
+ ksft_print_msg("no T and W\n");
+ goto out;
+ }
+ sleep_ns(100 * NSEC_PER_MSEC);
+ base = total_bw_of(cpu[0]) - bw_w;
+
+ srand(getpid() ^ now_ns());
+ end = now_ns() + RACE_SECS * NSEC_PER_SEC;
+ for (i = 1; now_ns() < end; i++) {
+ int64_t abs, lead, w0;
+ struct timespec ts;
+
+ set_flag(&rs->go, i);
+ if (wait_for_step(1000, 100 * NSEC_PER_USEC,
+ rs->t_ready == i || rs->t_ready == -i) ||
+ rs->t_ready != i) {
+ ksft_print_msg("round %d: T cannot become a deadline task\n", i);
+ goto out;
+ }
+ if (wait_for_step(100, 100 * NSEC_PER_USEC, proc_state_of(rs->t_tid) == 'S'))
+ continue;
+ /* Leave W 20ms to block, then time out within the write. */
+ lead = (int64_t)((double)rand() / RAND_MAX * 1.2 * dmax);
+ abs = realtime_ns() + 20 * NSEC_PER_MSEC + dmax;
+ rs->w_abs = abs;
+ set_flag(&rs->w_go, i);
+ if (wait_for_step(100, 100 * NSEC_PER_USEC, rs->w_blocked == i) ||
+ wait_for_step(100, 100 * NSEC_PER_USEC, proc_state_of(rs->w_tid) == 'S')) {
+ ksft_print_msg("round %d: W did not block\n", i);
+ goto out;
+ }
+ if (set_other(rs->t_tid)) {
+ ksft_print_msg("round %d: T cannot leave SCHED_DEADLINE\n", i);
+ goto out;
+ }
+ if (prio_of(rs->t_tid) != DL_TASK_PRIO) {
+ ksft_print_msg("round %d: W does not boost T\n", i);
+ goto out;
+ }
+ ts.tv_sec = (abs - lead) / NSEC_PER_SEC;
+ ts.tv_nsec = (abs - lead) % NSEC_PER_SEC;
+ while (clock_nanosleep(CLOCK_REALTIME, TIMER_ABSTIME, &ts, NULL) == EINTR)
+ ;
+ w0 = realtime_ns();
+ toggle_q(&q_root);
+ d = realtime_ns() - w0;
+ if (wait_for_step(1000, 100 * NSEC_PER_USEC, rs->w_done == i) || rs->w_err) {
+ ksft_print_msg("round %d: the wait of W did not time out\n", i);
+ goto out;
+ }
+ tb = total_bw_of(cpu[0]);
+ if (tb != base + bw_w + bw_t) {
+ ksft_print_msg("round %d: total_bw of R %lld, %lld expected%s\n",
+ i, tb, base + bw_w + bw_t,
+ tb == base + bw_w ? ": T is missing" : "");
+ ksft_print_msg("round %d: timeout %lldus into a write of %lldus\n",
+ i, (long long)(rs->w_ret - w0) / 1000, (long long)d / 1000);
+ goto out;
+ }
+ /* Past the 0-lag time of T: R counts W only. */
+ if (wait_for_step(1000, 5 * NSEC_PER_MSEC, total_bw_of(cpu[0]) == base + bw_w)) {
+ ksft_print_msg("round %d: past the 0-lag time of T, total_bw of R %lld, %lld expected\n",
+ i, total_bw_of(cpu[0]), base + bw_w);
+ goto out;
+ }
+ }
+ ret = KSFT_PASS;
+out:
+ set_flag(&rs->go, -1);
+ set_flag(&rs->w_go, -1);
+ reap(proc);
+ reap(filler);
+ munmap(rs, sizeof(*rs));
+out_cg:
+ remove_partition(cg_q);
+ remove_partition(cg_r);
+ return ret;
+}
+
/* The tables of the cases, and main() */
enum where {
@@ -12614,6 +13087,7 @@ static const struct p_case {
{ "pi_unlock_running", pi_unlock_running, MEASURED_IN_P },
{ "pi_chain_two_owners", pi_chain_two_owners, MEASURED_IN_P },
{ "pi_departed_moved", pi_departed_moved, FROM_OUTSIDE },
+ { "pi_departed_offline_boost", pi_departed_offline_boost, FROM_OUTSIDE },
{ "params_asleep", params_asleep, IN_P },
{ "params_non_contending", params_non_contending, MEASURED_IN_P },
{ "params_switched_asleep", params_switched_asleep, MEASURED_IN_P },
@@ -12703,6 +13177,7 @@ static const struct p_case {
{ "params_swap_overload", params_swap_overload, FROM_OUTSIDE },
{ "random_mix", random_mix, FROM_OUTSIDE },
{ "move_normalized", move_normalized, FROM_OUTSIDE },
+ { "pi_deboost_during_rebuild", pi_deboost_during_rebuild, FROM_OUTSIDE },
};
#define N_P_CASES ((int)ARRAY_SIZE(p_cases))
--
2.47.3
next prev parent reply other threads:[~2026-12-01 17:44 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 17:43 [PATCH v13 00/36] sched/deadline: bandwidth accounting fixes and selftests Mathieu Desnoyers
2026-12-01 17:43 ` [PATCH v13 01/36] sched/deadline: Hold a reference on the deadline donor of a boosted task Mathieu Desnoyers
2026-12-01 17:43 ` [PATCH v13 02/36] sched/deadline: Replenish a throttled task boosted while asleep Mathieu Desnoyers
2026-12-01 17:43 ` [PATCH v13 03/36] sched/deadline: Do not truncate a bandwidth to 32 bits in __dl_add/sub() Mathieu Desnoyers
2026-12-01 17:43 ` [PATCH v13 04/36] sched/deadline: Count the 0-lag time from the next period Mathieu Desnoyers
2026-12-01 17:43 ` [PATCH v13 05/36] sched/deadline: Keep a departing constrained task until its " Mathieu Desnoyers
2026-12-01 18:17 ` sashiko-bot
2026-12-01 17:44 ` [PATCH v13 06/36] sched/deadline: Keep departing bandwidth across a root domain rebuild Mathieu Desnoyers
2026-12-01 18:20 ` sashiko-bot
2026-12-01 17:44 ` [PATCH v13 07/36] sched/deadline: Rebuild the root domains' accounting from the task list Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 08/36] sched/deadline: Record the root domain holding a task's bandwidth Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 09/36] sched/deadline: Leave a dying task out of a rebuild of the accounting Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 10/36] selftests/sched: Test SCHED_DEADLINE bandwidth across a root domain rebuild Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 11/36] selftests/sched: Test the root domain rebuild in deadline_bw_test Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 12/36] sched/deadline: Move a task's bandwidth only where room was made Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 13/36] cgroup/cpuset: Wait for an attach before rebuilding the sched domains Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 14/36] sched: Make deadline policy and affinity changes wait for a cpuset attach Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 15/36] cgroup/cpuset: Give back the bandwidth an attach did not move Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 16/36] cgroup/cpuset: Reserve the bandwidth in the root domain a task moves to Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 17/36] selftests/sched: Test cpuset moves in deadline_bw_test Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 18/36] sched/deadline: Make a rebuild count a task in the root domain it runs in Mathieu Desnoyers
2026-12-01 19:11 ` sashiko-bot
2026-12-01 17:44 ` [PATCH v13 19/36] sched/deadline: Move a task's bandwidth to " Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 20/36] sched/deadline: Keep a task in the root domain that counts its bandwidth Mathieu Desnoyers
2026-12-01 19:02 ` sashiko-bot
2026-12-01 17:44 ` [PATCH v13 21/36] sched/deadline: Keep the last CPU a task has in its root domain Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 22/36] cgroup/cpuset: Refuse to take a deadline task out of " Mathieu Desnoyers
2026-12-01 19:29 ` sashiko-bot
2026-12-01 17:44 ` [PATCH v13 23/36] selftests/sched: Test the root domain of a task in deadline_bw_test Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 24/36] sched/deadline: Count only active CPUs when spreading extra_bw Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 25/36] sched/deadline: Cancel the replenishment timer with the parameters Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 26/36] sched/deadline: Cap the runtime left of a constrained task at dl_runtime Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 27/36] sched/deadline: Check the runtime of a task that comes back runnable Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 28/36] sched/deadline: Record the start of the period Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 29/36] sched/deadline: Keep the debt of a task across a change of parameters Mathieu Desnoyers
2026-12-01 17:44 ` [PATCH v13 30/36] selftests/sched: Test parameter changes in deadline_bw_test Mathieu Desnoyers
2026-12-01 19:34 ` sashiko-bot
2026-12-01 17:44 ` [PATCH v13 31/36] sched/deadline: Count a task that departs while a rebuild walks the tasks Mathieu Desnoyers
2026-12-01 19:41 ` sashiko-bot
2026-12-01 17:44 ` [PATCH v13 32/36] sched/deadline: Count again a departed task that a boost brings back Mathieu Desnoyers
2026-12-01 19:47 ` sashiko-bot
2026-12-01 17:44 ` [PATCH v13 33/36] sched/deadline: Keep a reaped deadline task in a rebuild Mathieu Desnoyers
2026-12-01 19:57 ` sashiko-bot
2026-12-01 17:44 ` [PATCH v13 34/36] sched/deadline: Warn when a runqueue keeps the bandwidth of a task Mathieu Desnoyers
2026-12-01 17:44 ` Mathieu Desnoyers [this message]
2026-12-01 19:51 ` [PATCH v13 35/36] selftests/sched: Test PI against hotplug and rebuilds in deadline_bw_test sashiko-bot
2026-12-01 17:44 ` [PATCH v13 36/36] selftests/sched: Share the helpers of the deadline tests 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=e61bc31fa01c8c19e29db0067c9d4a9882fdbd54.1796146461.git.mathieu.desnoyers@efficios.com \
--to=mathieu.desnoyers@efficios.com \
--cc=bigeasy@linutronix.de \
--cc=boqun@kernel.org \
--cc=brauner@kernel.org \
--cc=bsegall@google.com \
--cc=cgroups@vger.kernel.org \
--cc=clrkwllms@kernel.org \
--cc=dietmar.eggemann@arm.com \
--cc=hannes@cmpxchg.org \
--cc=juri.lelli@redhat.com \
--cc=kayracizmeci@gmail.com \
--cc=kprateek.nayak@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-rt-devel@lists.linux.dev \
--cc=longman@redhat.com \
--cc=luca.abeni@santannapisa.it \
--cc=m.szyprowski@samsung.com \
--cc=mathieu.poirier@linaro.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=mkoutny@suse.com \
--cc=oleg@redhat.com \
--cc=parri.andrea@gmail.com \
--cc=peterz@infradead.org \
--cc=ridong.chen@linux.dev \
--cc=rostedt@goodmis.org \
--cc=shuah@kernel.org \
--cc=tglx@kernel.org \
--cc=tj@kernel.org \
--cc=tommaso.cucinotta@gmail.com \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
--cc=weihengqiuu@gmail.com \
--cc=will@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®