]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sched_ext: selftests/dsp_local_on: Fix selftest on UP systems
authorAndrea Righi <arighi@nvidia.com>
Sat, 25 Jan 2025 09:36:07 +0000 (10:36 +0100)
committerTejun Heo <tj@kernel.org>
Mon, 27 Jan 2025 19:00:09 +0000 (09:00 -1000)
In UP systems p->migration_disabled is not available. Fix this by using
the portable helper is_migration_disabled(p).

Fixes: e9fe182772dc ("sched_ext: selftests/dsp_local_on: Fix sporadic failures")
Signed-off-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
tools/testing/selftests/sched_ext/dsp_local_on.bpf.c

index 758b479bd1ee17bfec0c8cedcf842bfb71eacaea..c02b2aa6fc641eff1b8c0b8a0bf452d9a8f479ed 100644 (file)
@@ -43,7 +43,7 @@ void BPF_STRUCT_OPS(dsp_local_on_dispatch, s32 cpu, struct task_struct *prev)
        if (!p)
                return;
 
-       if (p->nr_cpus_allowed == nr_cpus && !p->migration_disabled)
+       if (p->nr_cpus_allowed == nr_cpus && !is_migration_disabled(p))
                target = bpf_get_prandom_u32() % nr_cpus;
        else
                target = scx_bpf_task_cpu(p);