Limited queueing in NMI for rqspinlock
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
- v2 Latest6 patches 1 replyApplied 6/6
- v16 patches 1 replySuperseded
Patches in v2 All 6 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | rqspinlock: Enclose lock/unlock within lock entry acquisitionsinclude/ kernel/ | +38 | 0 replies | Applied |
| 2/6 | rqspinlock: Perform AA checks immediatelykernel/ | +7 | 0 replies | Applied |
| 3/6 | rqspinlock: Use trylock fallback when per-CPU rqnode is busykernel/ | +1 | 1 reply | Applied |
| 4/6 | rqspinlock: Disable spinning for trylock fallbackkernel/ | +8 | 0 replies | Applied |
| 5/6 | rqspinlock: Precede non-head waiter queueing with AA checkkernel/ | +13 | 0 replies | Applied |
| 6/6 | selftests/bpf: Add success stats to rqspinlock stress testtools/ | +43 | 0 replies | Applied |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH bpf-next v2 0/6] Limited queueing in NMI for rqspinlock
Ritesh reported that he was frequently seeing timeouts in cases which should have been covered by the AA heuristics. This led to the discovery of multiple gaps in the current code that could lead to timeouts when AA heuristics could work to prevent them. More details and investigation is available in the original threads. [0][1]
This set restores the ability for NMI waiters to queue in the slow path, and reduces the cases where they would attempt to trylock. However, such queueing must not happen when interrupting waiters which the NMI itself depends upon for forward progress; in those cases the trylock fallback remains, but with a single attempt to avoid aimless attempts to acquire the lock.
It also closes a possible window in the lock fast path and the unlock path where NMIs landing between cmpxchg and entry creation, or entry deletion and unlock would miss the detection of an AA scenario and end up timing out.
This virtually eliminates all the cases where existing heuristics can prevent timeouts and quickly recover from a deadlock. More details are available in the commit logs for each patch.
[0]: https://lore.kernel.org/bpf/CAH6OuBTjG+N=+GGwcpOUbeDN563oz4iVcU3rbse68egp9wj9_A@mail.gmail.com
[1]: https://lore.kernel.org/bpf/[email protected]
Kumar Kartikeya Dwivedi (6):
rqspinlock: Enclose lock/unlock within lock entry acquisitions
rqspinlock: Perform AA checks immediately
rqspinlock: Use trylock fallback when per-CPU rqnode is busy
rqspinlock: Disable spinning for trylock fallback
rqspinlock: Precede non-head waiter queueing with AA check selftests/bpf: Add success stats to rqspinlock stress test
include/asm-generic/rqspinlock.h | 60 ++++++++-------- kernel/bpf/rqspinlock.c | 69 +++++++++---------- .../bpf/test_kmods/bpf_test_rqspinlock.c | 55 +++++++++++---- 3 files changed, 108 insertions(+), 76 deletions(-)
base-commit: 688b745401ab16e2e1a3b504863f0a45fd345638
Signature · 1 line
2.51.0