Re: [RFC PATCH 0/3] Introduce a classic BPF filter cache for seccomp

From: Alexei Starovoitov

Date: Fri Nov 27 2026 - 19:33:45 EST


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.