mbox series

[bpf-next,v2,0/4] bpf: Fix warnings in kvmalloc_node()

Message ID 20231213112531.3775079-1-houtao@huaweicloud.com (mailing list archive)
Headers show
Series bpf: Fix warnings in kvmalloc_node() | expand

Message

Hou Tao Dec. 13, 2023, 11:25 a.m. UTC
From: Hou Tao <houtao1@huawei.com>

Hi,

The patch set aims to fix the warnings in kvmalloc_node() when passing
an abnormally big cnt during multiple kprobes/uprobes attachment.

Patch #1 and #2 fix the warning by limiting the maximal number of
uprobes/kprobes. Patch #3 and #4 add tests to ensure these warnings are
fixed.

Please see individual patches for more details. Comments are always
welcome.

Change Log:
v2:
  * limit the number of uprobes/kprobes instead of suppressing the
    out-of-memory warning message (Alexei)
  * provide a faked non-zero offsets to simplify the multiple uprobe
    test (Jiri)

v1: https://lore.kernel.org/bpf/20231211112843.4147157-1-houtao@huaweicloud.com/
  
Hou Tao (4):
  bpf: Limit the number of uprobes when attaching program to multiple
    uprobes
  bpf: Limit the number of kprobes when attaching program to multiple
    kprobes
  selftests/bpf: Add test for abnormal cnt during multi-uprobe
    attachment
  selftests/bpf: Add test for abnormal cnt during multi-kprobe
    attachment

 kernel/trace/bpf_trace.c                      |  7 ++--
 .../bpf/prog_tests/kprobe_multi_test.c        | 14 ++++++++
 .../bpf/prog_tests/uprobe_multi_test.c        | 33 ++++++++++++++++++-
 3 files changed, 51 insertions(+), 3 deletions(-)

Comments

Jiri Olsa Dec. 13, 2023, 2:42 p.m. UTC | #1
On Wed, Dec 13, 2023 at 07:25:27PM +0800, Hou Tao wrote:
> From: Hou Tao <houtao1@huawei.com>
> 
> Hi,
> 
> The patch set aims to fix the warnings in kvmalloc_node() when passing
> an abnormally big cnt during multiple kprobes/uprobes attachment.
> 
> Patch #1 and #2 fix the warning by limiting the maximal number of
> uprobes/kprobes. Patch #3 and #4 add tests to ensure these warnings are
> fixed.
> 
> Please see individual patches for more details. Comments are always
> welcome.
> 
> Change Log:
> v2:
>   * limit the number of uprobes/kprobes instead of suppressing the
>     out-of-memory warning message (Alexei)
>   * provide a faked non-zero offsets to simplify the multiple uprobe
>     test (Jiri)
> 
> v1: https://lore.kernel.org/bpf/20231211112843.4147157-1-houtao@huaweicloud.com/
>   
> Hou Tao (4):
>   bpf: Limit the number of uprobes when attaching program to multiple
>     uprobes
>   bpf: Limit the number of kprobes when attaching program to multiple
>     kprobes
>   selftests/bpf: Add test for abnormal cnt during multi-uprobe
>     attachment
>   selftests/bpf: Add test for abnormal cnt during multi-kprobe
>     attachment
> 
>  kernel/trace/bpf_trace.c                      |  7 ++--
>  .../bpf/prog_tests/kprobe_multi_test.c        | 14 ++++++++
>  .../bpf/prog_tests/uprobe_multi_test.c        | 33 ++++++++++++++++++-
>  3 files changed, 51 insertions(+), 3 deletions(-)

with one minor comment, for the patchset

Acked-by: Jiri Olsa <jolsa@kernel.org>

thanks,
jirka

> 
> -- 
> 2.29.2
>