Re: [PATCH] lib: test_objpool: add missing MODULE_DESCRIPTION() macro

2024-06-02 Thread wuqiang.matt
On 2024/6/1 08:31, Jeff Johnson wrote: make allmodconfig && make W=1 C=1 reports: WARNING: modpost: missing MODULE_DESCRIPTION() in lib/test_objpool.o Add the missing invocation of the MODULE_DESCRIPTION() macro. Signed-off-by: Jeff Johnson --- lib/test_objpool.c | 3 ++- 1 file changed, 2

Re: [PATCH v3 1/5] arch,locking/atomic: arc: arch_cmpxchg should check data size

2023-11-22 Thread wuqiang.matt
Hello Andi, On 2023/11/23 06:17, Andi Shyti wrote: Hi Wuqiang, On Tue, Nov 21, 2023 at 10:23:43PM +0800, wuqiang.matt wrote: arch_cmpxchg() should check data size rather than pointer size in case CONFIG_ARC_HAS_LLSC is defined. So rename __cmpxchg to __cmpxchg_32 to emphasize it's exp

[PATCH v3 5/5] arch,locking/atomic: xtensa: define arch_cmpxchg_local as __cmpxchg_local

2023-11-21 Thread wuqiang.matt
The xtensa architecture already has __cmpxchg_local defined but not used. The purpose of __cmpxchg_local() is solely for arch_cmpxchg_local(), just as the definition of arch_cmpxchg_local() for other architectures like x86, arm and powerpc. Signed-off-by: wuqiang.matt --- arch/xtensa/include

[PATCH v3 4/5] arch,locking/atomic: hexagon: add arch_cmpxchg[64]_local

2023-11-21 Thread wuqiang.matt
rwise generci_cmpxchg[64]_local is to be used. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202310272207.tlpflya4-...@intel.com/ Signed-off-by: wuqiang.matt Reviewed-by: Masami Hiramatsu (Google) --- arch/hexagon/include/asm/cmpxchg.h | 51 +- 1

[PATCH v3 3/5] arch,locking/atomic: openrisc: add arch_cmpxchg[64]_local

2023-11-21 Thread wuqiang.matt
rwise generci_cmpxchg[64]_local is to be used. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202310272207.tlpflya4-...@intel.com/ Signed-off-by: wuqiang.matt Reviewed-by: Masami Hiramatsu (Google) --- arch/openrisc/include/asm/cmpxchg.h | 6 ++ 1 file changed, 6 inser

[PATCH v3 2/5] arch,locking/atomic: arc: add arch_cmpxchg[64]_local

2023-11-21 Thread wuqiang.matt
rwise generci_cmpxchg[64]_local is to be used. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202310272207.tlpflya4-...@intel.com/ Signed-off-by: wuqiang.matt Reviewed-by: Masami Hiramatsu (Google) --- arch/arc/include/asm/cmpxchg.h | 28 1

[PATCH v3 1/5] arch,locking/atomic: arc: arch_cmpxchg should check data size

2023-11-21 Thread wuqiang.matt
ive cmpxchg variants if avaialble, as Arnd advised Signed-off-by: wuqiang.matt Reviewed-by: Masami Hiramatsu (Google) --- arch/arc/include/asm/cmpxchg.h | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/arc/include/asm/cmpxchg.h b/arch/arc/include/asm/cmpx

[PATCH v3 0/5] arch,locking/atomic: add arch_cmpxchg[64]_local

2023-11-21 Thread wuqiang.matt
r arc/openrisc/hexagon. Patch 5 defines arch_cmpxchg_local as existing __cmpxchg_local rather the generic variant. wuqiang.matt (5): arch,locking/atomic: arc: arch_cmpxchg should check data size arch,locking/atomic: arc: add arch_cmpxchg[64]_local arch,locking/atomic: openrisc: add arch_cmpxc

[PATCH v2] lib: objpool: fix head overrun on big.LITTLE system

2023-11-20 Thread wuqiang.matt
ative:746406039 1000174750 1493236240 1998318364 2942911180 objpool: 349164852 467284332 702296756 934459713 1387898285 objpool+: 348388180 462750976 696606096 927865887 1368402195 Fixes: b4edb8d2d464 ("lib: objpool added: ring-array based lockless MPMC") v1 ->

Re: [PATCH v1] lib: objpool: fix head overrun on RK3588 SBC

2023-11-20 Thread wuqiang.matt
On 2023/11/20 13:18, Masami Hiramatsu (Google) wrote: On Tue, 14 Nov 2023 19:51:48 +0800 "wuqiang.matt" wrote: objpool overrun stress with test_objpool on OrangePi5+ SBC triggered the following kernel warnings: WARNING: CPU: 6 PID: 3115 at lib/objpool.c:168 objpool_push+0xc0/0

[PATCH v1] lib: objpool: fix head overrun on RK3588 SBC

2023-11-14 Thread wuqiang.matt
2T 4T 8T16T native: 30890508 60399915 123111980 242257008 494002946 objpool:14742531 28883047 57739948 115886644 232455421 objpool+: 14107220 29032998 57286084 113730493 232232850 24T32T48T 64T96T

[PATCH v1] lib: test_objpool: make global variables static

2023-11-07 Thread wuqiang.matt
-...@intel.com/ Signed-off-by: wuqiang.matt --- lib/test_objpool.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/test_objpool.c b/lib/test_objpool.c index a94078402138..bfdb81599832 100644 --- a/lib/test_objpool.c +++ b/lib/test_objpool.c @@ -311,7 +311,7 @@ static

[PATCH v2 3/4] locking/atomic: openrisc: arch_cmpxchg[64]_local undefined

2023-11-04 Thread wuqiang.matt
For architectures that support native cmpxchg, we'd like to implement arch_cmpxchg[64]_local with the native variants of supported data size. If not, the generci_cmpxchg[64]_local will be used. Signed-off-by: wuqiang.matt --- arch/openrisc/include/asm/cmpxchg.h | 6 ++ 1 file chang

[PATCH v2 4/4] locking/atomic: hexagon: arch_cmpxchg[64]_local undefined

2023-11-04 Thread wuqiang.matt
flya4-...@intel.com/ Signed-off-by: wuqiang.matt --- arch/hexagon/include/asm/cmpxchg.h | 51 +- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/arch/hexagon/include/asm/cmpxchg.h b/arch/hexagon/include/asm/cmpxchg.h index bf6cf5579cf4..2b5e5bbaf807 100644

[PATCH v2 2/4] locking/atomic: arc: arch_cmpxchg[64]_local undefined

2023-11-04 Thread wuqiang.matt
For architectures that support native cmpxchg, we'd like to implement arch_cmpxchg[64]_local with the native variants of supported data size. If not, the generci_cmpxchg[64]_local will be used. Signed-off-by: wuqiang.matt --- arch/arc/include/asm/cmpxchg.h | 28 ++

[PATCH v2 1/4] locking/atomic: arc: data size checking in arch_cmpxchg

2023-11-04 Thread wuqiang.matt
UG_ON checking is uncecessary. Signed-off-by: wuqiang.matt --- arch/arc/include/asm/cmpxchg.h | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/arc/include/asm/cmpxchg.h b/arch/arc/include/asm/cmpxchg.h index e138fde067de..bf46514f6f12 100644 --- a/arch/arc/in

[PATCH v2 0/4] locking/atomic: arch_cmpxchg[64]_local undefined

2023-11-04 Thread wuqiang.matt
This patch series implement arch_cmpxchg[64]_local for arc, openrisc and hexagon. For architectures that support native cmpxchg, we'd like to implement arch_cmpxchg[64]_local with the native variants of supported data size. If not, the generci_cmpxchg[64]_local will be used. wuqiang.ma

Re: [PATCH v1] lib,kprobes: using try_cmpxchg_local in objpool_push

2023-10-29 Thread wuqiang.matt
On 2023/10/30 01:05, Guenter Roeck wrote: On Mon, Oct 23, 2023 at 07:24:52PM +0800, wuqiang.matt wrote: The objpool_push can only happen on local cpu node, so only the local cpu can touch slot->tail and slot->last, which ensures the correctness of using cmpxchg without lock prefix

Re: [External] [PATCH] locking/atomic: sh: Use generic_cmpxchg_local for arch_cmpxchg_local()

2023-10-25 Thread wuqiang.matt
On 2023/10/24 22:52, Masami Hiramatsu (Google) wrote: From: Masami Hiramatsu (Google) Use generic_cmpxchg_local() for arch_cmpxchg_local() implementation in SH architecture because it does not implement arch_cmpxchg_local(). Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-k

Re: [PATCH] locking/atomic: sh: Use generic_cmpxchg_local for arch_cmpxchg_local()

2023-10-25 Thread wuqiang.matt
On 2023/10/25 09:51, wuqiang.matt wrote: On 2023/10/25 07:42, Masami Hiramatsu (Google) wrote: On Tue, 24 Oct 2023 16:08:12 +0100 Mark Rutland wrote: On Tue, Oct 24, 2023 at 11:52:54PM +0900, Masami Hiramatsu (Google) wrote: From: Masami Hiramatsu (Google) Use generic_cmpxchg_local() for

[PATCH] lib,kprobes: objpool_try_add_slot merged into objpool_push

2023-10-24 Thread wuqiang.matt
original loop of all cpu nodes removed Signed-off-by: wuqiang.matt --- lib/objpool.c | 26 +- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/lib/objpool.c b/lib/objpool.c index a032701beccb..7474a3a60cad 100644 --- a/lib/objpool.c +++ b/lib/objpool.c

Re: [PATCH] locking/atomic: sh: Use generic_cmpxchg_local for arch_cmpxchg_local()

2023-10-24 Thread wuqiang.matt
On 2023/10/25 07:42, Masami Hiramatsu (Google) wrote: On Tue, 24 Oct 2023 16:08:12 +0100 Mark Rutland wrote: On Tue, Oct 24, 2023 at 11:52:54PM +0900, Masami Hiramatsu (Google) wrote: From: Masami Hiramatsu (Google) Use generic_cmpxchg_local() for arch_cmpxchg_local() implementation in SH a

Re: [PATCH v1] lib,kprobes: using try_cmpxchg_local in objpool_push

2023-10-23 Thread wuqiang.matt
On 2023/10/24 09:01, Masami Hiramatsu (Google) wrote: On Mon, 23 Oct 2023 11:43:04 -0400 Steven Rostedt wrote: On Mon, 23 Oct 2023 19:24:52 +0800 "wuqiang.matt" wrote: The objpool_push can only happen on local cpu node, so only the local cpu can touch slot->tail and slot

[PATCH v1] lib,kprobes: using try_cmpxchg_local in objpool_push

2023-10-23 Thread wuqiang.matt
526317 1454991286 1861053557 2059530343 2171732306 Signed-off-by: wuqiang.matt --- lib/objpool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/objpool.c b/lib/objpool.c index ce0087f64400..a032701beccb 100644 --- a/lib/objpool.c +++ b/lib/objpool.c @@ -166,7

[PATCH v1] kprobes: unused header files removed

2023-10-23 Thread wuqiang.matt
://lore.kernel.org/oe-kbuild-all/202310191512.vvypku5z-...@intel.com/ Signed-off-by: wuqiang.matt --- kernel/trace/rethook.c | 2 -- lib/test_objpool.c | 6 -- 2 files changed, 8 deletions(-) diff --git a/kernel/trace/rethook.c b/kernel/trace/rethook.c index 13c8e6773892..6fd7d4ecbbc6 100644 --- a

Re: [PATCH v11 1/5] lib: objpool added: ring-array based lockless MPMC

2023-10-17 Thread wuqiang.matt
On 2023/10/18 10:18, Chengming Zhou wrote: On 2023/10/17 21:56, wuqiang.matt wrote: objpool is a scalable implementation of high performance queue for object allocation and reclamation, such as kretprobe instances. With leveraging percpu ring-array to mitigate hot spots of memory contention

[PATCH v11 4/5] kprobes: freelist.h removed

2023-10-17 Thread wuqiang.matt
This patch will remove freelist.h from kernel source tree, since the only use cases (kretprobe and rethook) are converted to objpool. Signed-off-by: wuqiang.matt --- include/linux/freelist.h | 129 --- 1 file changed, 129 deletions(-) delete mode 100644

[PATCH v11 5/5] MAINTAINERS: objpool added

2023-10-17 Thread wuqiang.matt
objpool, a scalable and lockless ring-array based object pool, was introduced to replace the original freelist (a LIFO queue based on singly linked list) to improve kretprobe scalability. Signed-off-by: wuqiang.matt --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a

[PATCH v11 3/5] kprobes: kretprobe scalability improvement

2023-10-17 Thread wuqiang.matt
376679233824782945292 objpool: 328192025 439439564 668534502 887401381 1319972072 Signed-off-by: wuqiang.matt --- include/linux/kprobes.h | 11 ++--- include/linux/rethook.h | 16 ++- kernel/kprobes.c| 93 + kernel/trace/fprob

[PATCH v11 2/5] lib: objpool test module added

2023-10-17 Thread wuqiang.matt
to control the objpool lifecycle 5) group 5: asynchronous mode with hrtimer hrtimer softirq is introduced to stress async objpool operations Signed-off-by: wuqiang.matt --- lib/Kconfig.debug | 11 + lib/Makefile | 2 + lib/test_objpool.c | 689

[PATCH v11 1/5] lib: objpool added: ring-array based lockless MPMC

2023-10-17 Thread wuqiang.matt
array, which consumes more memory than linked lists Signed-off-by: wuqiang.matt --- include/linux/objpool.h | 176 + lib/Makefile| 2 +- lib/objpool.c | 286 3 files changed, 463 insertions(+), 1 deletion

[PATCH v11 0/5] lib,kprobes: kretprobe scalability improvement

2023-10-17 Thread wuqiang.matt
releasing of objpool now covered wuqiang.matt (5): lib: objpool added: ring-array based lockless MPMC lib: objpool test module added kprobes: kretprobe scalability improvement with objpool kprobes: freelist.h removed MAINTAINERS: objpool added MAINTAINERS | 7 + include

Re: [PATCH v10 1/5] lib: objpool added: ring-array based lockless MPMC

2023-10-16 Thread wuqiang.matt
l for releasing */ +void objpool_fini(struct objpool_head *pool) +{ + int count = 1; /* extra ref for objpool itself */ + + /* drop all remained objects from objpool */ + while (objpool_pop(pool)) + count++; + + if (refcount_sub_and_test(count, &pool->ref)

Re: [PATCH v10 3/5] kprobes: kretprobe scalability improvement with objpool

2023-10-16 Thread wuqiang.matt
On 2023/10/16 21:21, Masami Hiramatsu (Google) wrote: On Sun, 15 Oct 2023 13:32:49 +0800 "wuqiang.matt" wrote: kretprobe is using freelist to manage return-instances, but freelist, as LIFO queue based on singly linked list, scales badly and reduces the overall throughput of

Re: [PATCH v10 1/5] lib: objpool added: ring-array based lockless MPMC

2023-10-16 Thread wuqiang.matt
On 2023/10/16 20:18, Masami Hiramatsu (Google) wrote: Hi Wuqiang, On Mon, 16 Oct 2023 10:45:30 +0800 "wuqiang.matt" wrote: On 2023/10/16 07:26, Masami Hiramatsu (Google) wrote: On Mon, 16 Oct 2023 00:06:11 +0800 "wuqiang.matt" wrote: On 2023/10/15 23:43, Masami Hira

Re: [PATCH v10 1/5] lib: objpool added: ring-array based lockless MPMC

2023-10-16 Thread wuqiang.matt
On 2023/10/16 20:18, Masami Hiramatsu (Google) wrote: Hi Wuqiang, On Mon, 16 Oct 2023 10:45:30 +0800 "wuqiang.matt" wrote: On 2023/10/16 07:26, Masami Hiramatsu (Google) wrote: On Mon, 16 Oct 2023 00:06:11 +0800 "wuqiang.matt" wrote: On 2023/10/15 23:43, Masami Hira

Re: [PATCH v10 1/5] lib: objpool added: ring-array based lockless MPMC

2023-10-15 Thread wuqiang.matt
On 2023/10/16 07:26, Masami Hiramatsu (Google) wrote: On Mon, 16 Oct 2023 00:06:11 +0800 "wuqiang.matt" wrote: On 2023/10/15 23:43, Masami Hiramatsu (Google) wrote: On Sun, 15 Oct 2023 13:32:47 +0800 "wuqiang.matt" wrote: objpool is a scalable implementation of high p

Re: [PATCH v10 1/5] lib: objpool added: ring-array based lockless MPMC

2023-10-15 Thread wuqiang.matt
On 2023/10/15 23:43, Masami Hiramatsu (Google) wrote: On Sun, 15 Oct 2023 13:32:47 +0800 "wuqiang.matt" wrote: objpool is a scalable implementation of high performance queue for object allocation and reclamation, such as kretprobe instances. With leveraging percpu ring-array to mi

[PATCH v10 5/5] MAINTAINERS: objpool added

2023-10-14 Thread wuqiang.matt
objpool, a scalable and lockless ring-array based object pool, was introduced to replace the original freelist (a LIFO queue based on singly linked list) to improve kretprobe scalability. Signed-off-by: wuqiang.matt --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a

[PATCH v10 4/5] kprobes: freelist.h removed

2023-10-14 Thread wuqiang.matt
This patch will remove freelist.h from kernel source tree, since the only use cases (kretprobe and rethook) are converted to objpool. Signed-off-by: wuqiang.matt --- include/linux/freelist.h | 129 --- 1 file changed, 129 deletions(-) delete mode 100644

[PATCH v10 3/5] kprobes: kretprobe scalability improvement with objpool

2023-10-14 Thread wuqiang.matt
376679233824782945292 objpool: 328192025 439439564 668534502 887401381 990067903 Signed-off-by: wuqiang.matt --- include/linux/kprobes.h | 11 ++--- include/linux/rethook.h | 16 ++- kernel/kprobes.c| 93 + kernel/trace/fprob

[PATCH v10 2/5] lib: objpool test module added

2023-10-14 Thread wuqiang.matt
to control the objpool lifecycle 5) group 5: asynchronous mode with hrtimer hrtimer softirq is introduced to stress async objpool operations Signed-off-by: wuqiang.matt --- lib/Kconfig.debug | 11 + lib/Makefile | 2 + lib/test_objpool.c | 689

[PATCH v10 1/5] lib: objpool added: ring-array based lockless MPMC

2023-10-14 Thread wuqiang.matt
array, which consumes more memory than linked lists Signed-off-by: wuqiang.matt --- include/linux/objpool.h | 176 + lib/Makefile| 2 +- lib/objpool.c | 286 3 files changed, 463 insertions(+), 1 deletion

[PATCH v10 0/5] lib,kprobes: kretprobe scalability improvement

2023-10-14 Thread wuqiang.matt
This patch series introduces a scalable and lockless ring-array based object pool to improve scalability of kretprobed routines. v10: *) objpool simplified and improved according to Masami's advices wuqiang.matt (5): lib: objpool added: ring-array based lockless MPMC lib: objpool

Re: [PATCH v9 1/5] lib: objpool added: ring-array based lockless MPMC

2023-10-12 Thread wuqiang.matt
On 2023/10/13 09:59, Masami Hiramatsu (Google) wrote: On Fri, 13 Oct 2023 01:36:05 +0800 "wuqiang.matt" wrote: On 2023/10/12 22:02, Masami Hiramatsu (Google) wrote: Hi Wuqiang, On Mon, 9 Oct 2023 17:23:34 +0800 wuqiang wrote: Hello Masami, Just got time for the new patch an

Re: [PATCH v9 1/5] lib: objpool added: ring-array based lockless MPMC

2023-10-12 Thread wuqiang.matt
return slot->entries[head & slot->mask] The pre-condition should be: CPU 1 tries to push to a full slot, in this case tail = head + capacity but tail & mask == head & mask Regards, wuqiang On 2023/9/25 17:42, Masami Hiramatsu (Google) wrote: Hi Wuqiang,

Re: [PATCH v9 1/5] lib: objpool added: ring-array based lockless MPMC

2023-10-12 Thread wuqiang.matt
ref upon +* objpool was already grabbed during pool +* initialization in objpool_init() + */ + if (refcount_dec_and_test(&pool->ref)) + objpool_free(pool); + } while (obj); +} +EXPORT_SYMBOL_GPL