linux/lib/tests
Harry Yoo (Oracle) 92af129b40 lib/tests/slub_kunit: add a test case for {kmalloc,kfree}_nolock
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 a1e244a9f1 ("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 interrupts (NMI or hardirq depending on
the arch) on the same task, invoking {kmalloc,kfree}_nolock() from the
overflow handler.

Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Harry Yoo (Oracle) <harry@kernel.org>
Link: https://patch.msgid.link/20260406090907.11710-3-harry@kernel.org
Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
2026-04-07 11:21:32 +02:00
..
module
base64_kunit.c lib: add KUnit tests for base64 encoding/decoding 2025-11-20 14:03:44 -08:00
bitfield_kunit.c
bitops_kunit.c lib/tests: extend KUnit test for bitops with more cases 2026-02-08 18:47:29 -05:00
blackhole_dev_kunit.c Networking changes for 6.15. 2025-03-26 21:48:21 -07:00
checksum_kunit.c
cmdline_kunit.c
cpumask_kunit.c
ffs_kunit.c KUnit: ffs: Validate all the __attribute_const__ annotations 2025-09-08 14:58:52 -07:00
fortify_kunit.c kunit/fortify: Add back "volatile" for sizeof() constants 2025-07-14 22:43:52 -07:00
glob_kunit.c lib/glob: convert selftest to KUnit 2026-01-26 19:07:13 -08:00
hashtable_test.c
is_signed_type_kunit.c
kfifo_kunit.c
kunit_iov_iter.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
list-private-test.c list: add kunit test for private list primitives 2026-02-08 00:13:32 -08:00
list-test.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
liveupdate.c tests/liveupdate: add in-kernel liveupdate test 2026-02-08 00:13:33 -08:00
longest_symbol_kunit.c kunit: fix longest symbol length test 2025-07-10 14:02:07 -06:00
Makefile mm.git review status for linus..mm-nonmm-stable 2026-02-12 12:13:01 -08:00
memcpy_kunit.c
min_heap_kunit.c lib/tests: convert test_min_heap module to KUnit 2026-01-26 19:07:10 -08:00
overflow_kunit.c kunit/overflow: Add tests for STACK_FLEX_ARRAY_SIZE() helper 2025-05-08 09:42:05 -07:00
printf_kunit.c printf: convert test_hashed into macro 2026-01-28 10:19:40 +01:00
randstruct_kunit.c lib/tests: randstruct: Add deep function pointer layout test 2025-05-08 09:42:40 -07:00
scanf_kunit.c
seq_buf_kunit.c seq_buf: Introduce KUnit tests 2025-07-19 23:03:24 -07:00
siphash_kunit.c
slub_kunit.c lib/tests/slub_kunit: add a test case for {kmalloc,kfree}_nolock 2026-04-07 11:21:32 +02:00
stackinit_kunit.c Kbuild: remove structleak gcc plugin 2025-04-30 21:57:09 +02:00
string_helpers_kunit.c
string_kunit.c string: provide strends() 2025-11-17 10:15:32 +01:00
test_bits.c test_bits: add tests for __GENMASK() and __GENMASK_ULL() 2025-07-31 11:28:03 -04:00
test_fprobe.c lib/test_fprobe: add testcase for mixed fprobe 2025-11-11 22:32:09 +09:00
test_hash.c
test_kprobes.c
test_linear_ranges.c
test_list_sort.c test_list_sort: fix up const mismatch 2026-01-05 15:32:03 -07:00
test_ratelimit.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
test_sort.c
usercopy_kunit.c kunit/usercopy: Disable u64 test on 32-bit SPARC 2025-04-28 10:32:43 -07:00
util_macros_kunit.c
uuid_kunit.c lib/tests: convert test_uuid module to KUnit 2026-01-20 19:44:18 -08:00