Re: [PATCH 2/2] selftests/sched_ext: add cpuset DL rollback test

From: Guopeng Zhang

Date: Sun Apr 19 2026 - 21:56:41 EST




在 2026/4/18 0:23, Cheng-Yang Chou 写道:
> Hi Guopeng,
>
> On Fri, Apr 17, 2026 at 11:37:42AM +0800, Guopeng Zhang wrote:
> [...]
>> +
>> +#ifndef SYS_sched_setattr
>> +#if defined(__x86_64__)
>> +#define SYS_sched_setattr 314
>> +#elif defined(__i386__)
>> +#define SYS_sched_setattr 351
>> +#elif defined(__aarch64__)
>
> Nit: Since RISC-V uses the same assigned syscall number as ARM64, it
> would be nice to support it here as well,
>
...
>
>> +static enum scx_test_status run(void *arg)
>> +{
>> + struct cpuset_dl_rollback_ctx *ctx = arg;
>> + char procs_path[PATH_MAX];
>> + long long before_bw, after_bw;
>> + int ret;
>> +
>> + ret = read_cpu_total_bw(ctx->target_cpu, &before_bw);
>> + SCX_FAIL_IF(ret, "Failed to read baseline total_bw (%d)", ret);
>
> The first read_cpu_total_bw() call is redundant because before_bw is
> overwritten after spawn_dl_child(). Use a separate variable for the
> baseline if needed. Otherwise, the second call already handles the same
> error check.
>
...
>> + SCX_FAIL_IF(ret, "Failed to start SCHED_DEADLINE child (%d)", ret);
>> +
>> + ret = read_cpu_total_bw(ctx->target_cpu, &before_bw);
>
> Overwritten here.
>
>> + SCX_FAIL_IF(ret, "Failed to read pre-move total_bw (%d)", ret);
>
Hi Cheng-Yang,

Thanks for the review.

Both comments make sense. The current test is implemented under
`selftests/sched_ext`. If this test case is later moved to
`selftests/cgroup`, I’ll address both points in the next revision.

Thanks,
Guopeng