BPF List
 help / color / mirror / Atom feed
From: "Kumar Kartikeya Dwivedi" <memxor@gmail.com>
To: "Alexei Starovoitov" <alexei.starovoitov@gmail.com>,
	<bpf@vger.kernel.org>
Cc: <daniel@iogearbox.net>, <andrii@kernel.org>, <eddyz87@gmail.com>
Subject: Re: [PATCH bpf-next v3 00/14] bpf: A stack in arena
Date: Wed, 04 Nov 2026 08:35:09 +0100	[thread overview]
Message-ID: <DMM94NDU83WN.337PKDJT31SOE@gmail.com> (raw)
In-Reply-To: <DMM3XWQJWG41.38YIBYIE2576N@gmail.com>

On Wed Nov 4, 2026 at 4:31 AM CET, Alexei Starovoitov wrote:
> On Tue, Nov 03, 2026 at 05:24 PM Alexei Starovoitov <alexei.starovoitov@gmail.com> wrote:
>> No released compiler emits this code. The change to the BPF backend of LLVM
>> is in review: https://github.com/llvm/llvm-project/pull/235577
>
> The flags are made for Rust. I tried them on C.
> C without __arena works. The kernel side of this series is enough for it.
> The LLVM side needs more work.
>
> -- libarena without __arena --
>
> '#define __arena' is empty. The compiler moves the globals, the heap and
> the locals to arena.
>
> 63 libarena progs out of 63 pass the verifier.
>
> The price against libarena with __arena: two times more casts, JITed code
> +18%, arena_malloc() +7%.
>
> So probably not a recommended approach, but works for "lazy" C developers.

Could you elaborate on this? Are the extra casts due to the fact that globals,
heaps, and locals on the stack are moving to arena memory? My understanding is
that 1-1, the compiler approach is still more efficient in terms of the casts
emitted (and 32-bit narrowing) vs BPF_F_ARENA_SCALAR.

  reply	other threads:[~2026-11-04  7:35 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-04  1:23 [PATCH bpf-next v3 00/14] bpf: A stack in arena Alexei Starovoitov
2026-11-04  1:23 ` [PATCH bpf-next v3 01/14] libbpf: Make arena 4 Gbyte when max_entries is not set Alexei Starovoitov
2026-11-04  1:23 ` [PATCH bpf-next v3 02/14] selftests/bpf: Test the default size of arena Alexei Starovoitov
2026-11-04  1:23 ` [PATCH bpf-next v3 03/14] bpf: Treat addr_space_cast of a pointer that is not in arena as a move Alexei Starovoitov
2026-11-04  2:12   ` bot+bpf-ci
2026-11-04  2:32     ` Alexei Starovoitov
2026-11-04  1:23 ` [PATCH bpf-next v3 04/14] selftests/bpf: Test addr_space_cast of pointers that are not in arena Alexei Starovoitov
2026-11-04  1:40   ` sashiko-bot
2026-11-04  1:23 ` [PATCH bpf-next v3 05/14] libbpf: Support .bss.addr_space.1 section Alexei Starovoitov
2026-11-04  1:59   ` bot+bpf-ci
2026-11-04  1:23 ` [PATCH bpf-next v3 06/14] libbpf: Relocate pointers that are stored in arena Alexei Starovoitov
2026-11-04  1:44   ` sashiko-bot
2026-11-04  2:02     ` Alexei Starovoitov
2026-11-04  2:32       ` Roman Gushchin
2026-11-04  2:37         ` Alexei Starovoitov
2026-11-04  1:59   ` bot+bpf-ci
2026-11-04  2:30     ` Alexei Starovoitov
2026-11-04  1:23 ` [PATCH bpf-next v3 07/14] selftests/bpf: Test pointers in arena and .bss.addr_space.1 Alexei Starovoitov
2026-11-04  1:23 ` [PATCH bpf-next v3 08/14] bpf: Introduce bpf register BPF_REG_ARENA_SP Alexei Starovoitov
2026-11-04  1:23 ` [PATCH bpf-next v3 09/14] bpf: Add stacks for programs to arena Alexei Starovoitov
2026-11-04  1:23 ` [PATCH bpf-next v3 10/14] bpf, x86: Add BPF_ATOMIC_LOCAL Alexei Starovoitov
2026-11-04  1:23 ` [PATCH bpf-next v3 11/14] bpf: Support BPF_REG_ARENA_SP in the verifier Alexei Starovoitov
2026-11-04  2:12   ` bot+bpf-ci
2026-11-04  1:23 ` [PATCH bpf-next v3 12/14] bpf, x86: Support BPF_REG_ARENA_SP Alexei Starovoitov
2026-11-04  1:23 ` [PATCH bpf-next v3 13/14] bpf, arm64: " Alexei Starovoitov
2026-11-04  1:24 ` [PATCH bpf-next v3 14/14] selftests/bpf: Add tests for BPF_REG_ARENA_SP Alexei Starovoitov
2026-11-04  2:12   ` bot+bpf-ci
2026-11-04  2:29     ` Alexei Starovoitov
2026-11-04  3:31 ` [PATCH bpf-next v3 00/14] bpf: A stack in arena Alexei Starovoitov
2026-11-04  7:35   ` Kumar Kartikeya Dwivedi [this message]
2026-11-04 18:02     ` Alexei Starovoitov
2026-11-04 20:10 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DMM94NDU83WN.337PKDJT31SOE@gmail.com \
    --to=memxor@gmail.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox