From: Xu Kuohai <xukuohai@huaweicloud.com>
To: bpf@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>,
Eduard Zingerman <eddyz87@gmail.com>,
Kumar Kartikeya Dwivedi <memxor@gmail.com>,
Song Liu <song@kernel.org>,
Yonghong Song <yonghong.song@linux.dev>,
Jiri Olsa <jolsa@kernel.org>,
Emil Tsalapatis <emil@etsalapatis.com>,
John Fastabend <john.fastabend@gmail.com>,
Puranjay Mohan <puranjay@kernel.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Mark Rutland <mark.rutland@arm.com>
Subject: [PATCH bpf-next 0/6] bpf, arm64: Reduce instruction sync IPIs
Date: Sun, 6 Dec 2026 09:23:41 +0000 [thread overview]
Message-ID: <cover.1796545068.git.xukuohai@huawei.com> (raw)
From: Xu Kuohai <xukuohai@huawei.com>
On arm64, instruction sync broadcasts IPIs to all online CPUs. A BPF
program with multiple subprograms can trigger this synchronization
once for every subprogram during loading.
So defer instruction sync until all JIT images have been created and
the program is ready to execute. Apply the same approach to trampoline
creation so struct_ops can sync multiple trampolines with one IPI
broadcast.
Also remove the synchronization performed when invalidating freed BPF
image, since the memory is no longer executable and new code is
synchronized before it can run.
Xu Kuohai (6):
bpf: Defer instruction sync to the end of load time
bpf: Defer trampoline creation instruction sync
arm64: patching: Add nosync helpers for instruction copy and set
bpf, arm64: Defer JIT instruction sync
bpf, arm64: Defer trampoline creation instruction sync
bpf, arm64: Remove instruction sync when invalidating freed memory
arch/arm64/include/asm/text-patching.h | 2 +
arch/arm64/kernel/patching.c | 63 +++++++++++++++++++++++---
arch/arm64/net/bpf_jit_comp.c | 22 +++++++--
include/linux/bpf.h | 6 +++
kernel/bpf/bpf_struct_ops.c | 4 ++
kernel/bpf/core.c | 17 ++++++-
kernel/bpf/trampoline.c | 3 ++
net/bpf/bpf_dummy_struct_ops.c | 3 ++
8 files changed, 108 insertions(+), 12 deletions(-)
--
2.47.3
next reply other threads:[~2026-12-06 9:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-06 9:23 Xu Kuohai [this message]
2026-12-06 9:23 ` [PATCH bpf-next 1/6] bpf: Defer instruction sync to the end of load time Xu Kuohai
2026-12-06 9:23 ` [PATCH bpf-next 2/6] bpf: Defer trampoline creation instruction sync Xu Kuohai
2026-12-06 9:23 ` [PATCH bpf-next 3/6] arm64: patching: Add nosync helpers for instruction copy and set Xu Kuohai
2026-12-06 10:12 ` sashiko-bot
2026-12-06 9:23 ` [PATCH bpf-next 4/6] bpf, arm64: Defer JIT instruction sync Xu Kuohai
2026-12-06 10:14 ` sashiko-bot
2026-12-06 9:23 ` [PATCH bpf-next 5/6] bpf, arm64: Defer trampoline creation " Xu Kuohai
2026-12-06 10:12 ` sashiko-bot
2026-12-06 9:23 ` [PATCH bpf-next 6/6] bpf, arm64: Remove instruction sync when invalidating freed memory Xu Kuohai
2026-12-06 10:19 ` bot+bpf-ci
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=cover.1796545068.git.xukuohai@huawei.com \
--to=xukuohai@huaweicloud.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=catalin.marinas@arm.com \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=emil@etsalapatis.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=memxor@gmail.com \
--cc=puranjay@kernel.org \
--cc=song@kernel.org \
--cc=will@kernel.org \
--cc=yonghong.song@linux.dev \
/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