linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/6] binder: Set up KUnit tests for alloc
@ 2025-07-14 18:53 Tiffany Yang
  2025-07-14 18:53 ` [PATCH v3 1/6] binder: Fix selftest page indexing Tiffany Yang
                   ` (5 more replies)
  0 siblings, 6 replies; 25+ messages in thread
From: Tiffany Yang @ 2025-07-14 18:53 UTC (permalink / raw)
  To: linux-kernel
  Cc: keescook, kernel-team, Greg Kroah-Hartman,
	Arve Hjønnevåg, Todd Kjos, Martijn Coenen,
	Joel Fernandes, Christian Brauner, Carlos Llamas,
	Suren Baghdasaryan, Brendan Higgins, David Gow, Rae Moar,
	linux-kselftest, kunit-dev

Hello,

binder_alloc_selftest provides a robust set of checks for the binder
allocator, but it rarely runs because it must hook into a running binder
process and block all other binder threads until it completes. The test
itself is a good candidate for conversion to KUnit, and it can be
further isolated from user processes by using a test-specific lru
freelist instead of the global one. This series converts the selftest
to KUnit to make it less burdensome to run and to set up a foundation
for unit testing future binder_alloc changes.

Thanks,
Tiffany

Tiffany Yang (6):
  binder: Fix selftest page indexing
  binder: Store lru freelist in binder_alloc
  kunit: test: Export kunit_attach_mm()
  binder: Scaffolding for binder_alloc KUnit tests
  binder: Convert binder_alloc selftests to KUnit
  binder: encapsulate individual alloc test cases

 drivers/android/Kconfig                    |  15 +-
 drivers/android/Makefile                   |   2 +-
 drivers/android/binder.c                   |  10 +-
 drivers/android/binder_alloc.c             |  39 +-
 drivers/android/binder_alloc.h             |  14 +-
 drivers/android/binder_alloc_selftest.c    | 306 -----------
 drivers/android/binder_internal.h          |   4 +
 drivers/android/tests/.kunitconfig         |   3 +
 drivers/android/tests/Makefile             |   3 +
 drivers/android/tests/binder_alloc_kunit.c | 573 +++++++++++++++++++++
 include/kunit/test.h                       |  12 +
 lib/kunit/user_alloc.c                     |   4 +-
 12 files changed, 645 insertions(+), 340 deletions(-)
 delete mode 100644 drivers/android/binder_alloc_selftest.c
 create mode 100644 drivers/android/tests/.kunitconfig
 create mode 100644 drivers/android/tests/Makefile
 create mode 100644 drivers/android/tests/binder_alloc_kunit.c

-- 
2.50.0.727.gbf7dc18ff4-goog


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

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

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-14 18:53 [PATCH v3 0/6] binder: Set up KUnit tests for alloc Tiffany Yang
2025-07-14 18:53 ` [PATCH v3 1/6] binder: Fix selftest page indexing Tiffany Yang
2025-07-15  4:52   ` Carlos Llamas
2025-07-16 14:27   ` Kees Cook
2025-07-16 22:07     ` Tiffany Yang
2025-07-14 18:53 ` [PATCH v3 2/6] binder: Store lru freelist in binder_alloc Tiffany Yang
2025-07-15  4:52   ` Carlos Llamas
2025-07-16 14:30   ` Kees Cook
2025-07-16 22:11     ` Tiffany Yang
2025-07-14 18:53 ` [PATCH v3 3/6] kunit: test: Export kunit_attach_mm() Tiffany Yang
2025-07-15  4:52   ` Carlos Llamas
2025-07-16 14:32   ` Kees Cook
2025-07-14 18:53 ` [PATCH v3 4/6] binder: Scaffolding for binder_alloc KUnit tests Tiffany Yang
2025-07-15  4:52   ` Carlos Llamas
2025-07-16 22:16     ` Tiffany Yang
2025-07-16 14:37   ` Kees Cook
2025-07-16 22:28     ` Tiffany Yang
2025-07-16 22:42       ` Carlos Llamas
2025-07-17  6:22         ` Kees Cook
2025-07-14 18:53 ` [PATCH v3 5/6] binder: Convert binder_alloc selftests to KUnit Tiffany Yang
2025-07-15  4:52   ` Carlos Llamas
2025-07-14 18:53 ` [PATCH v3 6/6] binder: encapsulate individual alloc test cases Tiffany Yang
2025-07-15  4:52   ` Carlos Llamas
2025-07-16 14:53   ` Kees Cook
2025-07-16 22:30     ` Tiffany Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).