[PATCH bpf-next 0/3] bpf: Move IPIs out of pack_mutex and reduce IBPB flushes
From: Xu Kuohai
Date: Wed Dec 02 2026 - 10:41:26 EST
From: Xu Kuohai <xukuohai@xxxxxxxxxx>
BPF JIT memory is allocated through the BPF program pack allocator,
which uses a global pack_mutex to protect its packs. While holding this
lock, the allocator currently sends IPI to all CPUs on two paths: IBPB
flush on the x86 alloc path and CPU pipeline flush on the arm64 free
path. Because the caller can be preempted while waiting for the IPI
completion, the lock can be held for a long time, causing heavy lock
contention on busy systems.
This series moves both IPI out of pack_mutex and tracks dirty state per
chunk instead of per pack to reduce IBPB flushes.
Xu Kuohai (3):
bpf: Move bpf_arch_text_invalidate() out of pack_mutex
bpf: Change dirty tracking from packs to chunks
bpf: Move branch predictor flush out of pack_mutex
kernel/bpf/core.c | 153 ++++++++++++++++++++++++++++++++++++++++------
1 file changed, 133 insertions(+), 20 deletions(-)
--
2.47.3