Skip to content

Commit 92f90d3

Browse files
mattwuqmhiramat
authored andcommitted
lib: objpool test module added
The test_objpool module (test_objpool) will run several testcases for objpool stress and performance evaluation. Each testcase will have all available cpu cores involved to create a situation of high parallel and high contention. As of now there are 5 groups and 5 * 2 testcases in total: 1) group 1: synchronous mode objpool is managed synchronously, that is, all objects are to be reclaimed before objpool finalization and the objpool owner makes sure of it. All threads on different cores run in the same pace 2) group 2: synchronous mode + hrtimer this case have 2 customers: normal threads and hrtimer softirqs 3) group 3: synchronous + overrun mode This test group is mainly for performance evaluation of missing cases when pre-allocated objects are less than the requested 4) group 4: asynchronous mode This case is just an emulation of kretprobe, with refcount used to control the objpool lifecycle 5) group 5: asynchronous mode with hrtimer hrtimer softirq is introduced to stress async objpool operations Link: https://lore.kernel.org/all/[email protected]/ Signed-off-by: wuqiang.matt <[email protected]> Acked-by: Masami Hiramatsu (Google) <[email protected]> Signed-off-by: Masami Hiramatsu (Google) <[email protected]>
1 parent b4edb8d commit 92f90d3

File tree

3 files changed

+709
-0
lines changed

3 files changed

+709
-0
lines changed

lib/Kconfig.debug

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2945,6 +2945,17 @@ config TEST_CLOCKSOURCE_WATCHDOG
29452945

29462946
If unsure, say N.
29472947

2948+
config TEST_OBJPOOL
2949+
tristate "Test module for correctness and stress of objpool"
2950+
default n
2951+
depends on m && DEBUG_KERNEL
2952+
help
2953+
This builds the "test_objpool" module that should be used for
2954+
correctness verification and concurrent testings of objects
2955+
allocation and reclamation.
2956+
2957+
If unsure, say N.
2958+
29482959
endif # RUNTIME_TESTING_MENU
29492960

29502961
config ARCH_USE_MEMTEST

lib/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ obj-$(CONFIG_KPROBES_SANITY_TEST) += test_kprobes.o
107107
obj-$(CONFIG_TEST_REF_TRACKER) += test_ref_tracker.o
108108
CFLAGS_test_fprobe.o += $(CC_FLAGS_FTRACE)
109109
obj-$(CONFIG_FPROBE_SANITY_TEST) += test_fprobe.o
110+
obj-$(CONFIG_TEST_OBJPOOL) += test_objpool.o
111+
110112
#
111113
# CFLAGS for compiling floating point code inside the kernel. x86/Makefile turns
112114
# off the generation of FPU/SSE* instructions for kernel proper but FPU_FLAGS

0 commit comments

Comments
 (0)