bpf: Shorten pack_mutex critical sections
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 2 repliesIn review
Changes since v1 from the cover letter
- Invalidate before taking pack_mutex on all archs, instead of dropping and retaking it on arm64
- New patch 1 for the deadlock
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | bpf: Don't allocate and free prog pack memory with pack_mutex heldkernel/ | +36 | 2 replies | |
| 2/2 | bpf: Invalidate freed prog pack memory without holding pack_mutexkernel/ | +3 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH bpf 0/2] bpf: Shorten pack_mutex critical sections
Patch 2 moves bpf_arch_text_invalidate() out of pack_mutex, as suggested on v1 [1].
That makes the frees fast enough to hit a deadlock that was already
there: the pack_mutex owner frees an empty pack and waits in flush_work() for vmalloc purge work, which cannot run while bpf_prog_free_deferred() items waiting for pack_mutex fill the system_percpu_wq pool. Patch 1 allocates and frees pack memory without pack_mutex. Seen on arm64; x86 and powerpc take the same path.
Changes since v1:
- Invalidate before taking pack_mutex on all archs, instead of dropping and retaking it on arm64
- New patch 1 for the deadlock
[1] https://lore.kernel.org/bpf/[email protected]/
Puranjay Mohan (2):
bpf: Don't allocate and free prog pack memory with pack_mutex held
bpf: Invalidate freed prog pack memory without holding pack_mutex
kernel/bpf/core.c | 58 +++++++++++++++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 19 deletions(-)
base-commit: 9abe2c42ecab6c86b54838d2d645ca2e10204606
Signature · 1 line
2.53.0-Meta