From: "Harry Yoo (Oracle)" <harry@kernel.org>
To: "Vlastimil Babka (SUSE)" <vbabka@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Hao Li <hao.li@linux.dev>, Christoph Lameter <cl@gentwo.org>,
David Rientjes <rientjes@google.com>,
Roman Gushchin <roman.gushchin@linux.dev>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Alexei Starovoitov <ast@kernel.org>
Subject: Re: [PATCH V1 2/2] lib/tests/slub_kunit: add a test case for {kmalloc,kfree}_nolock
Date: Fri, 3 Apr 2026 19:01:16 +0900 [thread overview]
Message-ID: <ac-P7LlFgbNTBxsc@hyeyoo> (raw)
In-Reply-To: <26e81ffe-08ad-4c3f-a360-d45c3cb32ee2@kernel.org>
On Thu, Apr 02, 2026 at 04:36:59PM +0200, Vlastimil Babka (SUSE) wrote:
> On 3/30/26 2:05 PM, Harry Yoo (Oracle) wrote:
> > Testing invocation of {kmalloc,kfree}_nolock() during kmalloc() or
> > kfree() is tricky, and it is even harder to ensure that slowpaths are
> > properly tested. Lack of such testing has led to late discovery of
> > the bug fixed by commit a1e244a9f177 ("mm/slab: use prandom if
> > !allow_spin").
> >
> > Add a slub_kunit test that allocates and frees objects in a tight loop
> > while a perf event triggers NMIs on the same task, invoking
> > {kmalloc,kfree}_nolock() from the NMI handler.
> >
> > Signed-off-by: Harry Yoo (Oracle) <harry@kernel.org>
>
> perf_event_create_kernel_counter() seems to only exist with
> CONFIG_PERF_EVENTS,
Thanks for catching that!
> there's not even some "return -EINVAL" skeleton
> otherwise, AFAICS.
Right.
> Didn't check the various other definitions, but guess
> we'll need to put some/all of this behind #ifdef's then?
I'll make sure it builds w/o CONFIG_PERF_EVENTS and send v2.
--
Cheers,
Harry / Hyeonggon
prev parent reply other threads:[~2026-04-03 10:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-30 12:05 [PATCH V1 0/2] slub_kunit: add a test case for {kmalloc,kfree}_nolock Harry Yoo (Oracle)
2026-03-30 12:05 ` [PATCH V1 1/2] MAINTAINERS: add lib/tests/slub_kunit.c to SLAB ALLOCATOR section Harry Yoo (Oracle)
2026-03-30 16:48 ` David Rientjes
2026-03-30 12:05 ` [PATCH V1 2/2] lib/tests/slub_kunit: add a test case for {kmalloc,kfree}_nolock Harry Yoo (Oracle)
2026-03-30 16:49 ` David Rientjes
2026-03-31 3:04 ` Harry Yoo (Oracle)
2026-04-02 14:36 ` Vlastimil Babka (SUSE)
2026-04-03 10:01 ` Harry Yoo (Oracle) [this message]
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=ac-P7LlFgbNTBxsc@hyeyoo \
--to=harry@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=ast@kernel.org \
--cc=cl@gentwo.org \
--cc=hao.li@linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=rientjes@google.com \
--cc=roman.gushchin@linux.dev \
--cc=vbabka@kernel.org \
/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