From: Changwoo Min <changwoo@igalia.com>
To: Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>,
Eduard Zingerman <eddyz87@gmail.com>,
Kumar Kartikeya Dwivedi <memxor@gmail.com>,
Shuah Khan <shuah@kernel.org>,
Emil Tsalapatis <emil@etsalapatis.com>
Cc: Martin KaFai Lau <martin.lau@linux.dev>,
Song Liu <song@kernel.org>,
Yonghong Song <yonghong.song@linux.dev>,
Jiri Olsa <jolsa@kernel.org>,
Ihor Solodrai <ihor.solodrai@linux.dev>,
david.dai@linux.dev, Gavin Guo <gavinguo@igalia.com>,
bpf@vger.kernel.org, sched-ext@lists.linux.dev,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
changwoo@igalia.com, kernel-dev@igalia.com
Subject: [PATCH bpf-next 0/3] selftests/bpf: libarena: Add ordered-walk and lockless-peek support to the rbtree
Date: Wed, 28 Oct 2026 15:00:43 +0900 [thread overview]
Message-ID: <20261028060046.549097-1-changwoo@igalia.com> (raw)
A sched_ext scheduler can build a task queue on libarena's rbtree, keyed
by vtime, in place of a vtime-ordered DSQ. Such a queue needs three things
the tree lacks. This series adds them:
- Serve equal keys in insertion order, as vtime-ordered DSQs do (1/3).
- Cache the leftmost node and the node count, so that other CPUs can
peek at the head and the length without the writer's lock, like
scx_bpf_dsq_peek() and scx_bpf_dsq_nr_queued(). Add rb_init() and
rb_fini() for a tree embedded in another object (2/3).
- Add rb_next(), so that a consumer can walk past tasks it cannot run
in key order (3/3).
Each patch adds selftests, which run with:
$> ./test_progs -t 'libarena/test_rbtree*'
Changwoo Min (3):
selftests/bpf: libarena: Order equal rbtree keys FIFO
selftests/bpf: libarena: Cache the rbtree's leftmost node and count
selftests/bpf: libarena: Add rb_next()
.../bpf/libarena/include/libarena/rbtree.h | 82 ++++-
.../bpf/libarena/selftests/test_rbtree.bpf.c | 300 ++++++++++++++++++
.../selftests/bpf/libarena/src/rbtree.bpf.c | 138 ++++++--
3 files changed, 493 insertions(+), 27 deletions(-)
base-commit: 4169c9c90532df9585c0a2ae513337a58f5e59ab
--
2.56.0
next reply other threads:[~2026-10-28 6:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-28 6:00 Changwoo Min [this message]
2026-10-28 6:00 ` [PATCH bpf-next 1/3] selftests/bpf: libarena: Order equal rbtree keys FIFO Changwoo Min
2026-10-28 6:00 ` [PATCH bpf-next 2/3] selftests/bpf: libarena: Cache the rbtree's leftmost node and count Changwoo Min
2026-10-28 6:00 ` [PATCH bpf-next 3/3] selftests/bpf: libarena: Add rb_next() Changwoo Min
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=20261028060046.549097-1-changwoo@igalia.com \
--to=changwoo@igalia.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=david.dai@linux.dev \
--cc=eddyz87@gmail.com \
--cc=emil@etsalapatis.com \
--cc=gavinguo@igalia.com \
--cc=ihor.solodrai@linux.dev \
--cc=jolsa@kernel.org \
--cc=kernel-dev@igalia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.com \
--cc=sched-ext@lists.linux.dev \
--cc=shuah@kernel.org \
--cc=song@kernel.org \
--cc=yonghong.song@linux.dev \
/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
all inboxes | Powered by JetHome®