]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
lib: Add stress test for ratelimit
authorPaul E. McKenney <paulmck@kernel.org>
Tue, 6 May 2025 18:43:32 +0000 (11:43 -0700)
committerPaul E. McKenney <paulmck@kernel.org>
Tue, 24 Jun 2025 12:47:35 +0000 (05:47 -0700)
commit5c23ce0cb897b491a12667e3c15288eb03f8928d
treebc4d32711ab34a499ab57717871836166168c989
parent5a5c5a3de1c7af579a9670b7d4b0169120ec92a7
lib: Add stress test for ratelimit

Add a simple stress test for lib/ratelimit.c

To run on x86:

./tools/testing/kunit/kunit.py run --arch x86_64 --kconfig_add CONFIG_RATELIMIT_KUNIT_TEST=y --kconfig_add CONFIG_SMP=y --qemu_args "-smp 4" lib_ratelimit

On a 16-CPU system, the "4" in "-smp 4" can be varied between 1 and 8.
Larger numbers have higher probabilities of introducing delays that
break the smoke test.  In the extreme case, increasing the number to
larger than the number of CPUs in the underlying system is an excellent
way to get a test failure.

Link: https://lore.kernel.org/all/fbe93a52-365e-47fe-93a4-44a44547d601@paulmck-laptop/
Link: https://lore.kernel.org/all/20250423115409.3425-1-spasswolf@web.de/
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Kuniyuki Iwashima <kuniyu@amazon.com>
Cc: Mateusz Guzik <mjguzik@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: John Ogness <john.ogness@linutronix.de>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Jon Pan-Doh <pandoh@google.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Karolina Stolarek <karolina.stolarek@oracle.com>
lib/tests/test_ratelimit.c