Skip to content

Refactor lock management

Kumar Kartikeya Dwivedi bpf 6 versions – Applied

Status from this message: This series was applied to bpf/bpf-next.git (master)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest2 patches 0 repliesApplied 2/2
  2. v52 patches 1 replySuperseded
  3. v41 patch 4 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v31 patch2 repliesSuperseded
v21 patch0 repliesSuperseded
v11 patch0 repliesSuperseded

Changes in v6 from the cover letter

v5: https://lore.kernel.org/bpf/[email protected]

* Move active_locks mutation to {acquire,release}_lock_state (Alexei)

Patches in v6 All 2 applied

#Subject and filesSizeRepliesApplied
1/2bpf: Refactor active lock managementinclude/linux/bpf_verifier.h kernel/bpf/verifier.c+132 -670 repliesApplied
2/2bpf: Drop special callback reference handlinginclude/linux/bpf_verifier.h kernel/bpf/verifier.c tools/testing/selftests/bpf/prog_tests/cb_refs.c+11 -390 repliesApplied

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v6 yet.

Read the v6 thread

Cover letter [PATCH bpf-next v6 0/2] Refactor lock management

This set refactors lock management in the verifier in preparation for spin locks that can be acquired multiple times. In addition to this, unnecessary code special case reference leak logic for callbacks is also dropped, that is no longer necessary. See patches for details.

Changelog:
----------
v5 -> v6
v5: https://lore.kernel.org/bpf/[email protected]

* Move active_locks mutation to {acquire,release}_lock_state (Alexei)

v4 -> v5
v4: https://lore.kernel.org/bpf/[email protected]

* Make active_locks part of bpf_func_state (Alexei)
* Remove unneeded in_callback_fn logic for references

v3 -> v4
v3: https://lore.kernel.org/bpf/[email protected]

* Address comments from Alexei
* Drop struct bpf_active_lock definition
* Name enum type, expand definition to multiple lines
* s/REF_TYPE_BPF_LOCK/REF_TYPE_LOCK/g
* Change active_lock type to int
* Fix type of 'type' in acquire_lock_state
* Filter by taking type explicitly in find_lock_state
* WARN for default case in refsafe switch statement

v2 -> v3
v2: https://lore.kernel.org/bpf/[email protected]

* Rebase on bpf-next to resolve merge conflict

v1 -> v2
v1: https://lore.kernel.org/bpf/[email protected]

* Fix refsafe state comparison to check callback_ref and ptr separately.

Kumar Kartikeya Dwivedi (2):
bpf: Refactor active lock management
bpf: Drop special callback reference handling

 include/linux/bpf_verifier.h                  |  40 ++---
 kernel/bpf/verifier.c                         | 165 ++++++++++++------
 .../selftests/bpf/prog_tests/cb_refs.c        |   4 +-
 3 files changed, 123 insertions(+), 86 deletions(-)

base-commit: 163ea3dec3c8048618f561a2c3b30f4c5795e991

Signature · 1 line
2.43.5