Skip to content

Commit d0e8fde

Browse files
AnishMulaygregkh
authored andcommitted
selftests/mm: skip migration tests if NUMA is unavailable
[ Upstream commit 54218f1 ] 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: 0c2d087 ("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 946b31b commit d0e8fde

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

tools/testing/selftests/mm/migration.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ FIXTURE_SETUP(migration)
3333
{
3434
int n;
3535

36-
ASSERT_EQ(numa_available(), 0);
36+
if (numa_available() < 0)
37+
SKIP(return, "NUMA not available");
3738
self->nthreads = numa_num_task_cpus() - 1;
3839
self->n1 = -1;
3940
self->n2 = -1;

0 commit comments

Comments
 (0)