diff options
| author | Pawan Gupta <pawan.kumar.gupta@linux.intel.com> | 2026-06-29 22:38:54 -0700 |
|---|---|---|
| committer | Daniel Borkmann <daniel@iogearbox.net> | 2026-07-01 10:33:45 +0200 |
| commit | a9b1f19a6a673ba06820898d0f1ad02883ea1639 (patch) | |
| tree | 0a8b7398bc9aa2b10005593656ab166ea861d03a /Documentation/pps/git@git.tavy.me:linux.git | |
| parent | a23c1c5396a91680703360d1ee28a44657c503c4 (diff) | |
bpf: Prefer packs that won't trigger an IBPB flush on allocation
Currently BPF pack allocator picks the chunks from the first available
pack. While this is okay, it naturally leads to more frequent flushes
when there are multiple packs in the system that weren't used since the
last flush.
As an optimization prefer allocating the new programs from packs that
are unused since last flush. When all packs are dirty, allocation forces
a flush and marks all packs clean.
Below are some future optimizations ideas:
1. Currently, the "dirty" tracking is only done at the pack-level.
Flush frequency can further be reduced with chunk-level tracking.
This requires a new bitmap per-pack to track the dirty state.
2. IBPB flush is done on all CPUs, even if only a single CPU ran the
BPF program. On a system with hundreds of CPUs this could be a
major bottleneck forcing hundreds of IPIs to deliver the flush.
The solution is to track the CPUs where a BPF program ran, and
issue IBPB only on those CPUs.
3. Avoid IBPB when flush is already done at other sources (e.g.
context switch).
Signed-off-by: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'Documentation/pps/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions
