linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Audra Mitchell <audra@redhat.com>
Cc: shuah@kernel.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	mhocko@suse.com, surenb@google.com, rppt@kernel.org,
	vbabka@suse.cz, Liam.Howlett@oracle.com,
	lorenzo.stoakes@oracle.com, david@kernel.org, urezki@gmail.com,
	raquini@redhat.com
Subject: Re: [PATCH] lib/test_vmalloc.c: Minor fixes to test_vmalloc.c
Date: Sun, 18 Jan 2026 17:30:36 -0800	[thread overview]
Message-ID: <20260118173036.fd0784f59848303024065b9b@linux-foundation.org> (raw)
In-Reply-To: <20251201181848.1216197-1-audra@redhat.com>

On Mon,  1 Dec 2025 13:18:48 -0500 Audra Mitchell <audra@redhat.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.




  reply	other threads:[~2026-01-19  1:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-01 18:18 Audra Mitchell
2026-01-19  1:30 ` Andrew Morton [this message]
2026-01-19 11:36   ` Uladzislau Rezki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260118173036.fd0784f59848303024065b9b@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=Liam.Howlett@oracle.com \
    --cc=audra@redhat.com \
    --cc=david@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=mhocko@suse.com \
    --cc=raquini@redhat.com \
    --cc=rppt@kernel.org \
    --cc=shuah@kernel.org \
    --cc=surenb@google.com \
    --cc=urezki@gmail.com \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox