bpf: Move IPIs out of pack_mutex and reduce IBPB flushes
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 5 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | bpf: Move bpf_arch_text_invalidate() out of pack_mutexkernel/ | +10 | 2 replies | |
| 2/3 | bpf: Change dirty tracking from packs to chunkskernel/ | +64 | 1 reply | |
| 3/3 | bpf: Move branch predictor flush out of pack_mutexkernel/ | +61 | 2 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH bpf-next 0/3] bpf: Move IPIs out of pack_mutex and reduce IBPB flushes
From: Xu Kuohai <[email protected]>
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(-)
Signature · 1 line
2.47.3