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

Message ID 20221218050310.1338630-1-wuqiang.matt@bytedance.com
Headers
Series lib,kprobes: kretprobe scalability improvement |

Message

wuqiang.matt Dec. 18, 2022, 5:03 a.m. UTC
  This patch series introduces a scalable and lockless ring-array based
object pool and replaces the original freelist (a LIFO queue based on
singly linked list) to improve scalability of kretprobed routines.

v8:
  1) objpool: refcount added for objpool lifecycle management

v7:
  1) objpool: implementation simplified as Masami advised
  2) rethook_alloc: error codes returning supported (ERR_PTR)
  3) MAINTAINERS: support added for objpool files
  4) synced to latest 6.1 with x86_64/x86/aarch64 verified

wuqiang (5):
  lib: objpool added: ring-array based lockless MPMC queue
  lib: objpool test module added
  kprobes: kretprobe scalability improvement with objpool
  kprobes: freelist.h removed
  MAINTAINERS: objpool added

 MAINTAINERS              |   7 +
 include/linux/freelist.h | 129 --------
 include/linux/kprobes.h  |  11 +-
 include/linux/objpool.h  | 116 +++++++
 include/linux/rethook.h  |  16 +-
 kernel/kprobes.c         |  93 +++---
 kernel/trace/fprobe.c    |  37 +--
 kernel/trace/rethook.c   |  91 +++---
 lib/Kconfig.debug        |  11 +
 lib/Makefile             |   4 +-
 lib/objpool.c            | 372 +++++++++++++++++++++
 lib/test_objpool.c       | 682 +++++++++++++++++++++++++++++++++++++++
 12 files changed, 1292 insertions(+), 277 deletions(-)
 delete mode 100644 include/linux/freelist.h
 create mode 100644 include/linux/objpool.h
 create mode 100644 lib/objpool.c
 create mode 100644 lib/test_objpool.c
  

Comments

Masami Hiramatsu (Google) Dec. 29, 2022, 2:52 p.m. UTC | #1
Hi Matt,

Sorry, I missed to commented v7 patch. Anyway, please read
my comments on previous version.

On Sun, 18 Dec 2022 13:03:05 +0800
wuqiang <wuqiang.matt@bytedance.com> wrote:

> This patch series introduces a scalable and lockless ring-array based
> object pool and replaces the original freelist (a LIFO queue based on
> singly linked list) to improve scalability of kretprobed routines.
> 
> v8:
>   1) objpool: refcount added for objpool lifecycle management

At least this update part looks good to me.
(But I think this may be useful only for kretprobe/rethook
use cases...)

Thank you,

> 
> v7:
>   1) objpool: implementation simplified as Masami advised
>   2) rethook_alloc: error codes returning supported (ERR_PTR)
>   3) MAINTAINERS: support added for objpool files
>   4) synced to latest 6.1 with x86_64/x86/aarch64 verified
> 
> wuqiang (5):
>   lib: objpool added: ring-array based lockless MPMC queue
>   lib: objpool test module added
>   kprobes: kretprobe scalability improvement with objpool
>   kprobes: freelist.h removed
>   MAINTAINERS: objpool added
> 
>  MAINTAINERS              |   7 +
>  include/linux/freelist.h | 129 --------
>  include/linux/kprobes.h  |  11 +-
>  include/linux/objpool.h  | 116 +++++++
>  include/linux/rethook.h  |  16 +-
>  kernel/kprobes.c         |  93 +++---
>  kernel/trace/fprobe.c    |  37 +--
>  kernel/trace/rethook.c   |  91 +++---
>  lib/Kconfig.debug        |  11 +
>  lib/Makefile             |   4 +-
>  lib/objpool.c            | 372 +++++++++++++++++++++
>  lib/test_objpool.c       | 682 +++++++++++++++++++++++++++++++++++++++
>  12 files changed, 1292 insertions(+), 277 deletions(-)
>  delete mode 100644 include/linux/freelist.h
>  create mode 100644 include/linux/objpool.h
>  create mode 100644 lib/objpool.c
>  create mode 100644 lib/test_objpool.c
> 
> -- 
> 2.34.1
>
  
Steven Rostedt Feb. 5, 2023, 10:22 a.m. UTC | #2
On Thu, 29 Dec 2022 23:52:20 +0900
Masami Hiramatsu (Google) <mhiramat@kernel.org> wrote:

> Hi Matt,
> 
> Sorry, I missed to commented v7 patch. Anyway, please read
> my comments on previous version.
> 
> On Sun, 18 Dec 2022 13:03:05 +0800
> wuqiang <wuqiang.matt@bytedance.com> wrote:
> 
> > This patch series introduces a scalable and lockless ring-array based
> > object pool and replaces the original freelist (a LIFO queue based on
> > singly linked list) to improve scalability of kretprobed routines.
> > 
> > v8:
> >   1) objpool: refcount added for objpool lifecycle management  
> 
> At least this update part looks good to me.
> (But I think this may be useful only for kretprobe/rethook
> use cases...)
> 

Masami,

Were there other updates you expected from this series?

-- Steve
  
wuqiang.matt Feb. 6, 2023, 3:40 a.m. UTC | #3
Hi Steve,

I'm still working on the v9, but these days I'm a bit tied up with projects
at work. Hopefully I can figure it out this month.

Thanks,
Matt

On 2023/2/5 18:22, Steven Rostedt wrote:
> On Thu, 29 Dec 2022 23:52:20 +0900
> Masami Hiramatsu (Google) <mhiramat@kernel.org> wrote:
> 
>> Hi Matt,
>>
>> Sorry, I missed to commented v7 patch. Anyway, please read
>> my comments on previous version.
>>
>> On Sun, 18 Dec 2022 13:03:05 +0800
>> wuqiang <wuqiang.matt@bytedance.com> wrote:
>>
>>> This patch series introduces a scalable and lockless ring-array based
>>> object pool and replaces the original freelist (a LIFO queue based on
>>> singly linked list) to improve scalability of kretprobed routines.
>>>
>>> v8:
>>>    1) objpool: refcount added for objpool lifecycle management
>>
>> At least this update part looks good to me.
>> (But I think this may be useful only for kretprobe/rethook
>> use cases...)
>>
> 
> Masami,
> 
> Were there other updates you expected from this series?
> 
> -- Steve