]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
selftests/mm: skip migration tests if NUMA is unavailable
authorAnishMulay <anishm7030@gmail.com>
Wed, 18 Feb 2026 16:39:41 +0000 (11:39 -0500)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 5 Apr 2026 20:52:57 +0000 (13:52 -0700)
Currently, the migration test asserts that numa_available() returns 0.  On
systems where NUMA is not available (returning -1), such as certain ARM64
configurations or single-node systems, this assertion fails and crashes
the test.

Update the test to check the return value of numa_available().  If it is
less than 0, skip the test gracefully instead of failing.

This aligns the behavior with other MM selftests (like rmap) that skip
when NUMA support is missing.

Link: https://lkml.kernel.org/r/20260218163941.13499-1-anishm7030@gmail.com
Fixes: 0c2d08728470 ("mm: add selftests for migration entries")
Signed-off-by: AnishMulay <anishm7030@gmail.com>
Reviewed-by: SeongJae Park <sj@kernel.org>
Reviewed-by: Dev Jain <dev.jain@arm.com>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Tested-by: Sayali Patil <sayalip@linux.ibm.com>
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
tools/testing/selftests/mm/migration.c

index ee24b88c2b24834475d77323d855bcdec3475eff..60e78bbfc0e3e8df9a8520e06574f41859b82884 100644 (file)
@@ -36,7 +36,8 @@ FIXTURE_SETUP(migration)
 {
        int n;
 
-       ASSERT_EQ(numa_available(), 0);
+       if (numa_available() < 0)
+               SKIP(return, "NUMA not available");
        self->nthreads = numa_num_task_cpus() - 1;
        self->n1 = -1;
        self->n2 = -1;