Skip to content

Global subprogs in RCU/{preempt,irq}-disabled sections

Kumar Kartikeya Dwivedi bpf 3 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. v3 Latest3 patches 0 repliesApplied 3/3
  2. v23 patches 1 replySuperseded
  3. v12 patches 8 repliesSuperseded

Changes in v3 from the cover letter

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

* Fix broken to_be_replaced argument in the selftest.
* Adjust selftest program type.

Patches in v3 All 3 applied

#Subject and filesSizeRepliesApplied
1/3bpf: Summarize sleepable global subprogsinclude/linux/bpf.h include/linux/bpf_verifier.h kernel/bpf/verifier.c+50 -140 repliesApplied
2/3selftests/bpf: Test sleepable global subprogs in atomic contextstools/testing/selftests/bpf/prog_tests/rcu_read_lock.c tools/testing/selftests/bpf/prog_tests/spin_lock.c tools/testing/selftests/bpf/progs/irq.c +3 more+270 -20 repliesApplied
3/3selftests/bpf: Add tests for extending sleepable global subprogstools/testing/selftests/bpf/prog_tests/changes_pkt_data.c tools/testing/selftests/bpf/prog_tests/summarization.c tools/testing/selftests/bpf/progs/changes_pkt_data.c +2 more+238 -1470 repliesApplied

Reviews trailers per patch

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

Read the v3 thread

Cover letter [PATCH bpf-next v3 0/3] Global subprogs in RCU/{preempt,irq}-disabled sections

Small change to allow non-sleepable global subprogs in RCU, preempt-disabled, and irq-disabled sections. For now, we don't lift the limitation for locks as it requires more analysis, and will do this one resilient spin locks land.

This surfaced a bug where sleepable global subprogs were allowed in RCU read sections, that has been fixed. Tests have been added to cover various cases.

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

* Fix broken to_be_replaced argument in the selftest.
* Adjust selftest program type.

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

* Rename subprog_info[i].sleepable to might_sleep, which more accurately reflects the nature of the bit. 'sleepable' means whether a given context is allowed to, while might_sleep captures if it does.
* Disallow extensions that might sleep to attach to targets that don't sleep, since they'd be permitted to be called in atomic contexts. (Eduard)
* Add tests for mixing non-sleepable and sleepable global function calls, and extensions attaching to non-sleepable global functions. (Eduard)
* Rename changes_pkt_data -> summarization

Kumar Kartikeya Dwivedi (3):
bpf: Summarize sleepable global subprogs selftests/bpf: Test sleepable global subprogs in atomic contexts selftests/bpf: Add tests for extending sleepable global subprogs

 include/linux/bpf.h                           |   1 +
 include/linux/bpf_verifier.h                  |   1 +
 kernel/bpf/verifier.c                         |  62 ++++++--
 .../bpf/prog_tests/changes_pkt_data.c         | 107 -------------
 .../selftests/bpf/prog_tests/rcu_read_lock.c  |   3 +
 .../selftests/bpf/prog_tests/spin_lock.c      |   3 +
 .../selftests/bpf/prog_tests/summarization.c  | 144 ++++++++++++++++++
 .../selftests/bpf/progs/changes_pkt_data.c    |  39 -----
 tools/testing/selftests/bpf/progs/irq.c       |  71 ++++++++-
 .../selftests/bpf/progs/preempt_lock.c        |  68 ++++++++-
 .../selftests/bpf/progs/rcu_read_lock.c       |  58 +++++++
 .../selftests/bpf/progs/summarization.c       |  78 ++++++++++
 ...ta_freplace.c => summarization_freplace.c} |  17 ++-
 .../selftests/bpf/progs/test_spin_lock_fail.c |  69 +++++++++
 14 files changed, 558 insertions(+), 163 deletions(-)
 delete mode 100644 tools/testing/selftests/bpf/prog_tests/changes_pkt_data.c
 create mode 100644 tools/testing/selftests/bpf/prog_tests/summarization.c
 delete mode 100644 tools/testing/selftests/bpf/progs/changes_pkt_data.c
 create mode 100644 tools/testing/selftests/bpf/progs/summarization.c
 rename tools/testing/selftests/bpf/progs/{changes_pkt_data_freplace.c => summarization_freplace.c} (57%)

base-commit: 0b9363131daf4227d5ae11ee677acdcfff06e938

Signature · 1 line
2.43.5