[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20260118173036.fd0784f59848303024065b9b@linux-foundation.org>
Date: Sun, 18 Jan 2026 17:30:36 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Audra Mitchell <audra@...hat.com>
Cc: shuah@...nel.org, linux-kselftest@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-mm@...ck.org, mhocko@...e.com,
surenb@...gle.com, rppt@...nel.org, vbabka@...e.cz,
Liam.Howlett@...cle.com, lorenzo.stoakes@...cle.com, david@...nel.org,
urezki@...il.com, raquini@...hat.com
Subject: Re: [PATCH] lib/test_vmalloc.c: Minor fixes to test_vmalloc.c
On Mon, 1 Dec 2025 13:18:48 -0500 Audra Mitchell <audra@...hat.com> wrote:
> 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.
>
> ...
>
> --- a/lib/test_vmalloc.c
> +++ b/lib/test_vmalloc.c
> @@ -57,6 +57,9 @@ __param(int, run_test_mask, 7,
> /* Add a new test case description here. */
> );
>
> +__param(int, nr_pcpu_objects, 35000,
> + "Number of pcpu objects to allocate for pcpu_alloc_test");
> +
> /*
> * This is for synchronization of setup phase.
> */
> @@ -292,24 +295,24 @@ pcpu_alloc_test(void)
> size_t size, align;
> int i;
>
> - pcpu = vmalloc(sizeof(void __percpu *) * 35000);
> + pcpu = vmalloc(sizeof(void __percpu *) * nr_pcpu_objects);
Could have used vmalloc_array() here. Otherwise lgtm, thanks.
Powered by blists - more mailing lists