Re: [RFC PATCH 0/3] Introduce a classic BPF filter cache for seccomp
From: Xu Kuohai
Date: Sat Nov 28 2026 - 01:14:34 EST
On 11/28/2026 8:33 AM, Alexei Starovoitov wrote:
On Fri, Nov 27, 2026 at 07:15 AM Xu Kuohai <xukuohai@xxxxxxxxxxxxxxx> wrote:
The free path is dominated by bpf_arch_text_invalidate(), which sends IPIs
to all CPUs and waits for completion. The wait happens after put_cpu(), so
the task is preemptible. If the task is preempted, other lock waiters remain
blocked until it is scheduled back and releases the lock. This can extend
the lock hold time to seconds.
After moving bpf_arch_text_invalidate() out of pack_mutex, the p99 VM
startup latency drops from 2.79 s to 170 ms under the same workload.
Awesome!
btw every free still sends these IPIs.
We can probably remove them.
aarch64_insn_set() can do caches_clean_inval_pou() only
like aarch64_insn_patch_text_nosync().
bpf_arch_text_invalidate() is its only caller and nothing runs in
the freed chunks.
It can be a separate patch, of course.
Yeah, I'll look into it.