Skip to content

slub_kunit: add a test case for {kmalloc,kfree}_nolock

Harry Yoo (Oracle) linux-mm lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 2 repliesIn review
  2. v12 patches 5 repliesSuperseded

Changes in v2 from the cover letter

- 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).

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2MAINTAINERS: add lib/tests/slub_kunit.c to SLAB ALLOCATOR sectionMAINTAINERS+1 -01 reply
2/2lib/tests/slub_kunit: add a test case for {kmalloc,kfree}_nolocklib/tests/slub_kunit.c+92 -00 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchDavid RientjesSeongJae Park
1/2A-b A-b
2/2A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH V2 0/2] slub_kunit: add a test case for {kmalloc,kfree}_nolock

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/[email protected]

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

Signature · 1 line
2.43.0