Skip to content

bpf: Nested rcu critical sections

Puranjay Mohan bpf 2 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. v2 Latest2 patches 2 repliesApplied 2/2
  2. v11 patch 8 repliesSuperseded

Changes in v2 from the cover letter

- Move the addition of new tests to a separate patch (Alexei)
- Avoid incrementing active_rcu_locks at two places (Eduard)

Patches in v2 All 2 applied

#Subject and filesSizeRepliesApplied
1/2bpf: support nested rcu critical sectionsinclude/linux/bpf_verifier.h kernel/bpf/verifier.c tools/testing/selftests/bpf/prog_tests/rcu_read_lock.c+24 -271 replyApplied
2/2selftests: bpf: Add tests for unbalanced rcu_read_locktools/testing/selftests/bpf/prog_tests/rcu_read_lock.c tools/testing/selftests/bpf/progs/rcu_read_lock.c+42 -01 replyApplied

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchEduard Zingerman
1/2A-b
2/2A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH bpf-next v2 0/2] bpf: Nested rcu critical sections

v1: https://lore.kernel.org/bpf/[email protected]/
Changes in v1->v2:
- Move the addition of new tests to a separate patch (Alexei)
- Avoid incrementing active_rcu_locks at two places (Eduard)

Support nested rcu critical sections by making the boolean flag active_rcu_lock a counter and use it to manage rcu critical section state. bpf_rcu_read_lock() increments this counter and bpf_rcu_read_unlock() decrements it, MEM_RCU -> PTR_UNTRUSTED transition happens when active_rcu_locks drops to 0.

Puranjay Mohan (2):
bpf: support nested rcu critical sections
selftests: bpf: Add tests for unbalanced rcu_read_lock

 include/linux/bpf_verifier.h                  |  2 +-
 kernel/bpf/verifier.c                         | 47 +++++++++----------
 .../selftests/bpf/prog_tests/rcu_read_lock.c  |  4 +-
 .../selftests/bpf/progs/rcu_read_lock.c       | 40 ++++++++++++++++
 4 files changed, 66 insertions(+), 27 deletions(-)
Signature · 1 line
2.47.1