All of lore.kernel.org
 help / color / mirror / Atom feed
From: Emil Tsalapatis <emil@etsalapatis.com>
To: bpf@vger.kernel.org
Cc: ast@kernel.org, andrii@kernel.org, memxor@gmail.com,
	daniel@iogearbox.net, eddyz87@gmail.com,
	Emil Tsalapatis <emil@etsalapatis.com>
Subject: [PATCH 0/6] selftests/bpf: Fixes and improvements for libarena
Date: Mon, 17 Aug 2026 15:16:10 -0400	[thread overview]
Message-ID: <20260817191616.11071-1-emil@etsalapatis.com> (raw)

This patchset addresses issues and feature gaps in libarena's existing
code, and optimizes some common code paths.

Patch 1 fixes up an inconsistency in the SPDX tags.
Patch 2 incorporates a followup patch for bitmaps that inlines
the nonatomic versions of the set/clear/test operations.
Patch 3 makes it safe to use the arena allocator under IRQ reentrancy.
Ensuring the allocator is correct under NMIs will be addressed in a
subsequent patch because it is a larger change.
Patches 4 to 6 add a calloc() interface for the allocator, along with
a benchmark that is useful for quickly finding obvious regressions
during development.

Signed-off-by: Emil Tsalapatis <emil@etsalapatis.com>

Emil Tsalapatis (6):
  selftests/bpf: libarena: Normalize SPDX headers across files
  selftests/bpf: libarena: Inline nonatomic bitmap operations
  selftests/bpf: libarena: Disable IRQs during allocation
  selftests/bpf: libarena: Add calloc() call
  selftests/bpf: libarena: Add a benchmark for malloc()/calloc()
  selftests/bpf: libarena: Optimize and make public arena_memset

 tools/testing/selftests/bpf/Makefile          |  18 +-
 tools/testing/selftests/bpf/bench.c           |   6 +
 .../selftests/bpf/benchs/bench_libarena.c     | 210 ++++++++++++++++++
 .../bpf/benchs/run_bench_libarena.sh          |  31 +++
 tools/testing/selftests/bpf/libarena/Makefile |  31 ++-
 .../bpf/libarena/benchs/bench_malloc.bpf.c    |  51 +++++
 .../libarena/include/bpf_arena_spin_lock.h    |   2 +-
 .../bpf/libarena/include/bpf_atomic.h         |   2 +-
 .../bpf/libarena/include/bpf_may_goto.h       |   1 +
 .../bpf/libarena/include/libarena/bitmap.h    |  30 ++-
 .../bpf/libarena/include/libarena/common.h    |  71 ++++++
 .../bpf/libarena/selftests/test_bitmap.bpf.c  |   3 +
 .../selftests/bpf/libarena/src/asan.bpf.c     |  21 +-
 .../selftests/bpf/libarena/src/bitmap.bpf.c   |  18 --
 .../selftests/bpf/libarena/src/buddy.bpf.c    |  44 ++--
 .../selftests/bpf/libarena/src/common.bpf.c   |  27 ++-
 16 files changed, 489 insertions(+), 77 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/benchs/bench_libarena.c
 create mode 100755 tools/testing/selftests/bpf/benchs/run_bench_libarena.sh
 create mode 100644 tools/testing/selftests/bpf/libarena/benchs/bench_malloc.bpf.c

-- 
2.54.0


             reply	other threads:[~2026-08-17 19:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-17 19:16 Emil Tsalapatis [this message]
2026-08-17 19:16 ` [PATCH 1/6] selftests/bpf: libarena: Normalize SPDX headers across files Emil Tsalapatis
2026-08-17 19:21   ` sashiko-bot
2026-08-17 19:16 ` [PATCH 2/6] selftests/bpf: libarena: Inline nonatomic bitmap operations Emil Tsalapatis
2026-08-17 19:26   ` sashiko-bot
2026-08-17 20:25   ` bot+bpf-ci
2026-08-17 19:16 ` [PATCH 3/6] selftests/bpf: libarena: Disable IRQs during allocation Emil Tsalapatis
2026-08-17 19:28   ` sashiko-bot
2026-08-17 20:38   ` bot+bpf-ci
2026-08-17 19:16 ` [PATCH 4/6] selftests/bpf: libarena: Add calloc() call Emil Tsalapatis
2026-08-17 19:23   ` sashiko-bot
2026-08-17 20:25   ` bot+bpf-ci
2026-08-17 19:16 ` [PATCH 5/6] selftests/bpf: libarena: Add a benchmark for malloc()/calloc() Emil Tsalapatis
2026-08-17 19:31   ` sashiko-bot
2026-08-17 20:25   ` bot+bpf-ci
2026-08-17 19:16 ` [PATCH 6/6] selftests/bpf: libarena: Optimize and make public arena_memset Emil Tsalapatis
2026-08-17 20:25   ` bot+bpf-ci

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=20260817191616.11071-1-emil@etsalapatis.com \
    --to=emil@etsalapatis.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=memxor@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.