]> git.ipfire.org Git - thirdparty/linux.git/commit
lib/test_vmalloc.c: minor fixes to test_vmalloc.c
authorAudra Mitchell <audra@redhat.com>
Mon, 1 Dec 2025 18:18:48 +0000 (13:18 -0500)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 21 Jan 2026 03:24:47 +0000 (19:24 -0800)
commita98ec863fdedf4940447f32ceda7d937bebd06a2
treec698b1bb7bdf124408e306867e798fac1737058b
parentbd4526e64bcff4cbeaefbbd91c40d3e38b9920a9
lib/test_vmalloc.c: minor fixes to test_vmalloc.c

If PAGE_SIZE is larger than 4k and if you have a system with a large
number of CPUs, this test can require a very large amount of memory
leading to oom-killer firing.  Given the type of allocation, the kernel
won't have anything to kill, causing the system to stall.

Add a parameter to the test_vmalloc driver to represent the number of
times a percpu object will be allocated.  Calculate this in
test_vmalloc.sh to be 90% of available memory or the current default of
35000, whichever is smaller.

Link: https://lkml.kernel.org/r/20251201181848.1216197-1-audra@redhat.com
Signed-off-by: Audra Mitchell <audra@redhat.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.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: Rafael Aquini <raquini@redhat.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: "Uladzislau Rezki (Sony)" <urezki@gmail.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/test_vmalloc.c
tools/testing/selftests/mm/test_vmalloc.sh