public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Harry Yoo (Oracle)" <harry@kernel.org>
To: Vlastimil Babka <vbabka@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Hao Li <hao.li@linux.dev>, Christoph Lameter <cl@gentwo.org>,
	David Rientjes <rientjes@google.com>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	Alexei Starovoitov <ast@kernel.org>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: [PATCH V2 0/2] slub_kunit: add a test case for {kmalloc,kfree}_nolock
Date: Mon,  6 Apr 2026 18:09:05 +0900	[thread overview]
Message-ID: <20260406090907.11710-1-harry@kernel.org> (raw)

Test bots don't seem to test kmalloc_nolock() and kfree_nolock(), so
subtle bugs are discovered late. To make it easier to test, add a kunit
test case that stresses these paths by combining a tight alloc/free loop
with perf-triggered interrupts that invoke {kmalloc,kfree}_nolock() from
the overflow handler.

While at it, also add the missing MAINTAINERS entry for slub_kunit.c.

v1->v2:
  - Fix build errors on arches without CONFIG_PERF_EVENTS (Thanks
    Vlastimil)
  - Rename some identifiers
  - Use GFP_KERNEL_ACCOUNT or GFP_KERNEL for kmalloc(), instead of 0 or
    __GFP_ACCOUNT (that was unnecessarily restrictive).

p.s. I was writing this test while developing kvfree_rcu_nolock(),
let's add a test case in advance.

Probably a similar test case for the page allocator is worth adding
but I'm not sure where the right place would be.

v1: https://lore.kernel.org/linux-mm/20260330120517.104743-1-harry@kernel.org

Harry Yoo (Oracle) (2):
  MAINTAINERS: add lib/tests/slub_kunit.c to SLAB ALLOCATOR section
  lib/tests/slub_kunit: add a test case for {kmalloc,kfree}_nolock

 MAINTAINERS            |  1 +
 lib/tests/slub_kunit.c | 92 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 93 insertions(+)


base-commit: dbc785fb4d9cfa0115e69e614fe20b4ab90f8366
-- 
2.43.0


             reply	other threads:[~2026-04-06  9:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-06  9:09 Harry Yoo (Oracle) [this message]
2026-04-06  9:09 ` [PATCH V2 1/2] MAINTAINERS: add lib/tests/slub_kunit.c to SLAB ALLOCATOR section Harry Yoo (Oracle)
2026-04-07  0:19   ` SeongJae Park
2026-04-06  9:09 ` [PATCH V2 2/2] lib/tests/slub_kunit: add a test case for {kmalloc,kfree}_nolock Harry Yoo (Oracle)

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=20260406090907.11710-1-harry@kernel.org \
    --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