On 2/18/26 17:39, AnishMulay wrote:
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.
Single-node system (my notebook)
$ ./migration
TAP version 13
1..6
# Starting 6 tests from 1 test cases.
# RUN migration.private_anon ...
# SKIP Not enough threads or NUMA nodes available
# OK migration.private_anon
ok 1 migration.private_anon # SKIP Not enough threads or NUMA nodes
available
# RUN migration.shared_anon ...
# SKIP Not enough threads or NUMA nodes available
# OK migration.shared_anon
ok 2 migration.shared_anon # SKIP Not enough threads or NUMA nodes available
# RUN migration.private_anon_thp ...
# SKIP Not enough threads or NUMA nodes available
# OK migration.private_anon_thp
ok 3 migration.private_anon_thp # SKIP Not enough threads or NUMA nodes
available
# RUN migration.shared_anon_thp ...
# SKIP Not enough threads or NUMA nodes available
# OK migration.shared_anon_thp
ok 4 migration.shared_anon_thp # SKIP Not enough threads or NUMA nodes
available
# RUN migration.private_anon_htlb ...
# SKIP Not enough threads or NUMA nodes available
# OK migration.private_anon_htlb
ok 5 migration.private_anon_htlb # SKIP Not enough threads or NUMA nodes
available
# RUN migration.shared_anon_htlb ...
# SKIP Not enough threads or NUMA nodes available
# OK migration.shared_anon_htlb
ok 6 migration.shared_anon_htlb # SKIP Not enough threads or NUMA nodes
available
# PASSED: 6 / 6 tests passed.
# 6 skipped test(s) detected. Consider enabling relevant config options
to improve coverage.
# Totals: pass:0 fail:0 xfail:0 xpass:0 skip:6 error:0
What numa_available() really checks is if the kernel supports NUMA by
trying get_mempolicy(). If that fails with ENOSYS or EPERM.
That should mostly (cases we care about) be the case if the kernel is
compiled without CONFIG_NUMA.
So a better description here would be "On kernels without CONFIG_NUMA,
this assertion ..."
Given that tools/testing/selftests/mm/config does not include
CONFIG_NUMA, I think we want to add here
Fixes: 0c2d08728470b ("mm: add selftests for migration entries")
Acked-by: David Hildenbrand (Arm) <[email protected]>
--
Cheers,
David