BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next v1 0/2] Arena Queued Spin Lock
@ 2025-01-17 22:37 Kumar Kartikeya Dwivedi
  2025-01-17 22:37 ` [PATCH bpf-next v1 1/2] selftests/bpf: Introduce qspinlock for BPF arena Kumar Kartikeya Dwivedi
  2025-01-17 22:37 ` [PATCH bpf-next v1 2/2] selftests/bpf: Add tests for qspinlock in " Kumar Kartikeya Dwivedi
  0 siblings, 2 replies; 3+ messages in thread
From: Kumar Kartikeya Dwivedi @ 2025-01-17 22:37 UTC (permalink / raw)
  To: bpf
  Cc: Alexei Starovoitov, Andrii Nakryiko, Daniel Borkmann,
	Martin KaFai Lau, Eduard Zingerman, Tejun Heo, Barret Rhoden,
	Josh Don, Dohyun Kim, kernel-team

Hello,

This set provides an implementation of queued spin lock for arena.
There is no support for resiliency and recovering from deadlocks yet.

These are split out from the rqspinlock patch set as independent pieces.

The maximum number of supported CPUs is 1024, but this can be increased
in the future if necessary.

The API supports returning an error, so resiliency support can be added
in the future.

I don't return ETIMEDOUT when cond_break fires. First we don't clean up
the queue properly when it fires, so the lock and arena is already
corrupt if a deadlock condition is triggered. Second, it's not trivial
to bubble up the error from xchg_tail and other helpers (like
smp_cond_load_*). It is better to instead implement resilient spin lock
support if we want to support proper unwinding in case of deadlock
errors.

Kumar Kartikeya Dwivedi (2):
  selftests/bpf: Introduce qspinlock for BPF arena
  selftests/bpf: Add tests for qspinlock in BPF arena

 .../selftests/bpf/bpf_arena_qspinlock.h       | 441 ++++++++++++++++++
 tools/testing/selftests/bpf/bpf_atomic.h      | 121 +++++
 .../bpf/prog_tests/arena_spin_lock.c          |  68 +++
 .../selftests/bpf/progs/arena_spin_lock.c     |  49 ++
 4 files changed, 679 insertions(+)
 create mode 100644 tools/testing/selftests/bpf/bpf_arena_qspinlock.h
 create mode 100644 tools/testing/selftests/bpf/bpf_atomic.h
 create mode 100644 tools/testing/selftests/bpf/prog_tests/arena_spin_lock.c
 create mode 100644 tools/testing/selftests/bpf/progs/arena_spin_lock.c


base-commit: 01f3ce5328c405179b2c69ea047c423dad2bfa6d
-- 
2.43.5


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-01-17 22:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-17 22:37 [PATCH bpf-next v1 0/2] Arena Queued Spin Lock Kumar Kartikeya Dwivedi
2025-01-17 22:37 ` [PATCH bpf-next v1 1/2] selftests/bpf: Introduce qspinlock for BPF arena Kumar Kartikeya Dwivedi
2025-01-17 22:37 ` [PATCH bpf-next v1 2/2] selftests/bpf: Add tests for qspinlock in " Kumar Kartikeya Dwivedi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox