public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2 0/2] slub_kunit: add a test case for {kmalloc,kfree}_nolock
@ 2026-04-06  9:09 Harry Yoo (Oracle)
  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-06  9:09 ` [PATCH V2 2/2] lib/tests/slub_kunit: add a test case for {kmalloc,kfree}_nolock Harry Yoo (Oracle)
  0 siblings, 2 replies; 4+ messages in thread
From: Harry Yoo (Oracle) @ 2026-04-06  9:09 UTC (permalink / raw)
  To: Vlastimil Babka, Andrew Morton
  Cc: Hao Li, Christoph Lameter, David Rientjes, Roman Gushchin,
	Alexei Starovoitov, linux-kernel, linux-mm

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-04-07  0:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-06  9:09 [PATCH V2 0/2] slub_kunit: add a test case for {kmalloc,kfree}_nolock Harry Yoo (Oracle)
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)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox