Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] Silence spurious warnings and crashes from kunit test suites
@ 2026-05-14  5:04 Jia He
  2026-05-14  5:04 ` [PATCH 1/7] init/initramfs_test: wait_for_initramfs() before running Jia He
                   ` (7 more replies)
  0 siblings, 8 replies; 15+ messages in thread
From: Jia He @ 2026-05-14  5:04 UTC (permalink / raw)
  To: linux-kernel, linux-fsdevel, linux-perf-users, linux-kselftest,
	kunit-dev, kasan-dev, linux-mm
  Cc: Arnd Bergmann, Greg Kroah-Hartman, Alexander Viro,
	Christian Brauner, Jan Kara, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Namhyung Kim, Mark Rutland,
	Alexander Shishkin, Jiri Olsa, Ian Rogers, Adrian Hunter,
	James Clark, Brendan Higgins, David Gow, Rae Moar,
	Alexander Potapenko, Marco Elver, Dmitry Vyukov, Andrew Morton,
	Jia He, Paul E. McKenney, Petr Mladek, Kees Cook,
	David Disseldorp

Running the full kunit suite on arm64 (128-core Neoverse N2) with 7.1-rc3+
produces a handful of backtraces that are not real kernel bugs but
rather test-infrastructure issues: races with boot-time code, missing
bounds checks, resource leaks, and sysfs duplicate-name splats.

This series fixes them one by one so that a clean kunit run no longer
leaves noise in dmesg:

 1. init/initramfs_test races with the async rootfs unpacker; add
    wait_for_initramfs() in suite .init.
 2. kfence kunit cases fail outright when the pool is unavailable;
    skip them instead.
 3. intlog2(0) / intlog10(0) hit a WARN_ON that is harmless; remove it.
 4. kunit_platform_device_add() triggers sysfs_warn_dup() on the
    duplicate-registration test; catch duplicates early in the kunit
    helper (best-effort; final protection remains in driver core/sysfs).
 5. misc_register() likewise hits sysfs_warn_dup(); reject duplicate
    names explicitly. misc->name is never NULL at this point since the
    existing code already dereferences it unconditionally.
 6. hw_breakpoint test_many_cpus overflows its array on machines with
    many cores; bail out at the limit.
 7. test_ratelimit stress test checks the wrong variable for kthread
    creation, leaks memory, and races on doneflag. Use goto-based
    cleanup to guarantee all started threads are stopped on failure.

All patches are independent and can be applied/reviewed separately.
Tested on arm64 Neoverse N2 (128-core arm64) with
CONFIG_KUNIT=y and CONFIG_KUNIT_ALL_TESTS=y.

Jia He (7):
  init/initramfs_test: wait_for_initramfs() before running
  kfence: kunit: skip when no pool is available
  lib/math/int_log: drop WARN_ON for value == 0
  kunit: platform: catch duplicate (name, id) in kunit_platform_device_add()
  misc: reject duplicate names in misc_register()
  hw_breakpoint_test: fix test_many_cpus failure on large systems
  lib/tests: test_ratelimit: fix stress test thread lifecycle and leak

 drivers/char/misc.c                |  22 ++++++++++++++++++
 init/initramfs_test.c              |  17 +++++++++++++-
 kernel/events/hw_breakpoint_test.c |  12 ++++++++++
 lib/kunit/platform.c               |  36 +++++++++++++++++++++++++++++
 lib/math/int_log.c                 |   8 ++-----
 lib/tests/test_ratelimit.c         |  26 ++++++++++++++++-----
 mm/kfence/kfence_test.c            |   6 +++--
 7 files changed, 115 insertions(+), 12 deletions(-)


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

end of thread, other threads:[~2026-05-14  8:02 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-14  5:04 [PATCH 0/7] Silence spurious warnings and crashes from kunit test suites Jia He
2026-05-14  5:04 ` [PATCH 1/7] init/initramfs_test: wait_for_initramfs() before running Jia He
2026-05-14  5:58   ` David Disseldorp
2026-05-14  5:04 ` [PATCH 2/7] kfence: kunit: skip when no pool is available Jia He
2026-05-14  7:54   ` Marco Elver
2026-05-14  5:04 ` [PATCH 3/7] lib/math/int_log: drop WARN_ON for value == 0 Jia He
2026-05-14  5:04 ` [PATCH 4/7] kunit: platform: catch duplicate (name, id) in kunit_platform_device_add() Jia He
2026-05-14  5:04 ` [PATCH 5/7] misc: reject duplicate names in misc_register() Jia He
2026-05-14  7:00   ` Greg Kroah-Hartman
2026-05-14  7:25     ` Justin He
2026-05-14  5:04 ` [PATCH 6/7] hw_breakpoint_test: fix test_many_cpus failure on large systems Jia He
2026-05-14  8:01   ` Marco Elver
2026-05-14  5:04 ` [PATCH 7/7] lib/tests: test_ratelimit: fix stress test thread lifecycle and leak Jia He
2026-05-14  7:02 ` [PATCH 0/7] Silence spurious warnings and crashes from kunit test suites Greg Kroah-Hartman
2026-05-14  7:17   ` Justin He

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