From: Kumar Kartikeya Dwivedi <memxor@gmail.com>
To: bpf@vger.kernel.org
Cc: Alexei Starovoitov <ast@kernel.org>,
Andrii Nakryiko <andrii@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Martin KaFai Lau <martin.lau@kernel.org>,
Eduard Zingerman <eddyz87@gmail.com>, Tejun Heo <tj@kernel.org>,
Barret Rhoden <brho@google.com>, Josh Don <joshdon@google.com>,
Dohyun Kim <dohyunkim@google.com>,
kernel-team@meta.com
Subject: [PATCH bpf-next v1 0/2] Arena Queued Spin Lock
Date: Fri, 17 Jan 2025 14:37:52 -0800 [thread overview]
Message-ID: <20250117223754.1020174-1-memxor@gmail.com> (raw)
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
next reply other threads:[~2025-01-17 22:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-17 22:37 Kumar Kartikeya Dwivedi [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250117223754.1020174-1-memxor@gmail.com \
--to=memxor@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=brho@google.com \
--cc=daniel@iogearbox.net \
--cc=dohyunkim@google.com \
--cc=eddyz87@gmail.com \
--cc=joshdon@google.com \
--cc=kernel-team@meta.com \
--cc=martin.lau@kernel.org \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox