]> www.infradead.org Git - users/jedix/linux-maple.git/commit
kunit, slub: add test_kfree_rcu() and test_leak_destroy()
authorVlastimil Babka <vbabka@suse.cz>
Wed, 7 Aug 2024 10:31:20 +0000 (12:31 +0200)
committerVlastimil Babka <vbabka@suse.cz>
Tue, 27 Aug 2024 12:12:51 +0000 (14:12 +0200)
commit4e1c44b3db79ba910adec32e2e1b920a0e34890a
treebab889e24ca41e809eaa7d807fcade71ad3ea752
parent6c6c47b063b593785202be158e61fe5c827d6677
kunit, slub: add test_kfree_rcu() and test_leak_destroy()

Add a test that will create cache, allocate one object, kfree_rcu() it
and attempt to destroy it. As long as the usage of kvfree_rcu_barrier()
in kmem_cache_destroy() works correctly, there should be no warnings in
dmesg and the test should pass.

Additionally add a test_leak_destroy() test that leaks an object on
purpose and verifies that kmem_cache_destroy() catches it.

Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
lib/slub_kunit.c