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