[PATCH bpf-next 4/4] selftests/bpf/benchs: Add overwrite mode bench for rb-libbpf

2025-08-03 Thread Xu Kuohai
From: Xu Kuohai Add overwrite mode bench for ring buffer. For reference, below are bench numbers collected from x86_64 and arm64. - x86_64 (AMD EPYC 9654) Ringbuf, multi-producer contention, overwrite mode == rb-libbpf nr_prod 1 14.970

[PATCH bpf-next 3/4] selftests/bpf: Add test for overwrite ring buffer

2025-08-03 Thread Xu Kuohai
From: Xu Kuohai Add test for overwiret mode ring buffer. Signed-off-by: Xu Kuohai --- tools/testing/selftests/bpf/Makefile | 3 +- .../selftests/bpf/prog_tests/ringbuf.c| 74 ++ .../bpf/progs/test_ringbuf_overwrite.c| 98 +++ 3 files

[PATCH bpf-next 1/4] bpf: Add overwrite mode for bpf ring buffer

2025-08-03 Thread Xu Kuohai
From: Xu Kuohai When the bpf ring buffer is full, new events can not be recorded util the consumer consumes some events to free space. This may cause critical events to be discarded, such as in fault diagnostic, where recent events are more critical than older ones. So add ovewrite mode for bpf

[PATCH bpf-next 0/4] Add overwrite mode for bpf ring buffer

2025-08-03 Thread Xu Kuohai
From: Xu Kuohai When the bpf ring buffer is full, new events can not be recorded util the consumer consumes some events to free space. This may cause critical events to be discarded, such as in fault diagnostic, where recent events are more critical than older ones. So add ovewrite mode for bpf

[PATCH bpf-next 2/4] libbpf: ringbuf: Add overwrite ring buffer process

2025-08-03 Thread Xu Kuohai
From: Xu Kuohai In overwrite mode, the producer does not wait for the consumer, so the consumer is responsible for handling conflicts. An optimistic method is used to resolve the conflicts: the consumer first reads consumer_pos, producer_pos and overwrite_pos, then calculates a read window and

Re: [PATCH bpf-next v3 0/2] bpf, arm64: support up to 12 arguments

2025-05-27 Thread Xu Kuohai
-0a32fe723...@bootlin.com --- Alexis Lothoré (eBPF Foundation) (1): selftests/bpf: enable many-args tests for arm64 Xu Kuohai (1): bpf, arm64: Support up to 12 function arguments arch/arm64/net/bpf_jit_comp.c| 225 --- tools/testing/selftests/b

Re: [PATCH bpf-next v2 1/2] bpf, arm64: Support up to 12 function arguments

2025-05-27 Thread Xu Kuohai
On 5/27/2025 4:45 PM, Alexis Lothoré wrote: [...] + /* We can not know for sure about exact alignment needs for +* struct passed on stack, so deny those +*/ + if (m->arg_flags[i] & BTF_FMODEL_STRUCT_ARG) + return

Re: [PATCH bpf-next v2 1/2] bpf, arm64: Support up to 12 function arguments

2025-05-27 Thread Xu Kuohai
On 5/22/2025 6:14 PM, Alexis Lothoré wrote: [...] -static void save_args(struct jit_ctx *ctx, int args_off, int nregs) +struct arg_aux { + /* how many args are passed through registers, the rest of the args are +* passed through stack +*/ + int args_in_regs; +

Re: [PATCH RFC bpf-next 1/4] bpf: add struct largest member size in func model

2025-04-25 Thread Xu Kuohai
On 4/24/2025 9:38 PM, Alexis Lothoré wrote: Hi Xu, On Thu Apr 24, 2025 at 2:00 PM CEST, Xu Kuohai wrote: On 4/24/2025 3:24 AM, Alexis Lothoré wrote: Hi Andrii, On Wed Apr 23, 2025 at 7:15 PM CEST, Andrii Nakryiko wrote: On Thu, Apr 17, 2025 at 12:14 AM Alexis Lothoré wrote: Hi Andrii

Re: [PATCH RFC bpf-next 1/4] bpf: add struct largest member size in func model

2025-04-24 Thread Xu Kuohai
On 4/24/2025 3:24 AM, Alexis Lothoré wrote: Hi Andrii, On Wed Apr 23, 2025 at 7:15 PM CEST, Andrii Nakryiko wrote: On Thu, Apr 17, 2025 at 12:14 AM Alexis Lothoré wrote: Hi Andrii, On Wed Apr 16, 2025 at 11:24 PM CEST, Andrii Nakryiko wrote: On Fri, Apr 11, 2025 at 1:32 PM Alexis Lothoré (

Re: [PATCH RFC bpf-next 1/4] bpf: add struct largest member size in func model

2025-04-20 Thread Xu Kuohai
On 4/21/2025 12:02 AM, Alexis Lothoré wrote: Hi Xu, On Thu Apr 17, 2025 at 4:10 PM CEST, Xu Kuohai wrote: On 4/17/2025 3:14 PM, Alexis Lothoré wrote: Hi Andrii, On Wed Apr 16, 2025 at 11:24 PM CEST, Andrii Nakryiko wrote: On Fri, Apr 11, 2025 at 1:32 PM Alexis Lothoré (eBPF Foundation

Re: [PATCH RFC bpf-next 1/4] bpf: add struct largest member size in func model

2025-04-17 Thread Xu Kuohai
On 4/17/2025 3:14 PM, Alexis Lothoré wrote: Hi Andrii, On Wed Apr 16, 2025 at 11:24 PM CEST, Andrii Nakryiko wrote: On Fri, Apr 11, 2025 at 1:32 PM Alexis Lothoré (eBPF Foundation) wrote: In order to properly JIT the trampolines needed to attach BPF programs to functions, some architectures