linux-yocto/tools/testing
Feng Tang 62798e3291 selftests/mm: compaction_test: support platform with huge mount of memory
commit ab00ddd802f80e31fc9639c652d736fe3913feae upstream.

When running mm selftest to verify mm patches, 'compaction_test' case
failed on an x86 server with 1TB memory.  And the root cause is that it
has too much free memory than what the test supports.

The test case tries to allocate 100000 huge pages, which is about 200 GB
for that x86 server, and when it succeeds, it expects it's large than 1/3
of 80% of the free memory in system.  This logic only works for platform
with 750 GB ( 200 / (1/3) / 80% ) or less free memory, and may raise false
alarm for others.

Fix it by changing the fixed page number to self-adjustable number
according to the real number of free memory.

Link: https://lkml.kernel.org/r/20250423103645.2758-1-feng.tang@linux.alibaba.com
Fixes: bd67d5c15c ("Test compaction of mlocked memory")
Signed-off-by: Feng Tang <feng.tang@linux.alibaba.com>
Acked-by: Dev Jain <dev.jain@arm.com>
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Tested-by: Baolin Wang <baolin.wang@inux.alibaba.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Sri Jayaramappa <sjayaram@akamai.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-05-22 14:12:25 +02:00
..
crypto/chacha20-s390
cxl cxl/port: Fix use-after-free, permit out-of-order decoder shutdown 2024-11-08 16:28:24 +01:00
fault-injection
ktest ktest: Fix Test Failures Due to Missing LOG_FILE Directories 2025-04-25 10:45:20 +02:00
kunit kunit: qemu_configs: SH: Respect kunit cmdline 2025-04-25 10:45:45 +02:00
memblock memblock tests: fix warning ‘struct seq_file’ declared inside parameter list 2023-09-14 10:51:28 +03:00
nvdimm tools/testing/nvdimm: Drop empty platform remove function 2023-06-07 13:30:21 -07:00
radix-tree test suite: use %zu to print size_t 2025-04-25 10:45:41 +02:00
scatterlist
selftests selftests/mm: compaction_test: support platform with huge mount of memory 2025-05-22 14:12:25 +02:00
vsock vsock/test: fix SEQPACKET message bounds test 2023-12-03 07:33:05 +01:00