linux/include/kunit
Eric Biggers 201ceb94aa kunit: irq: Ensure timer doesn't fire too frequently
Fix a bug where kunit_run_irq_test() could hang if the system is too
slow.  This was noticed with the crypto library tests in certain VMs.

Specifically, if kunit_irq_test_timer_func() and the associated hrtimer
code took over 5us to run, then the CPU would spend all its time
executing that code in hardirq context.  As a result, the task executing
kunit_run_irq_test() never had a chance to run, exit the loop, and
cancel the timer.

To fix it, make kunit_irq_test_timer_func() increase the timer interval
when the other contexts aren't having a chance to run.

Fixes: 950a81224e ("lib/crypto: tests: Add hash-test-template.h and gen-hash-testvecs.py")
Cc: stable@vger.kernel.org
Reviewed-by: David Gow <david@davidgow.net>
Link: https://lore.kernel.org/r/20260224033751.97615-1-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
2026-02-24 14:44:21 -08:00
..
assert.h kunit: Rename KUNIT_ASSERT_FAILURE to KUNIT_FAIL_AND_ABORT for readability 2024-07-12 10:12:05 -06:00
attributes.h kunit: Add ability to filter attributes 2023-07-26 13:29:15 -06:00
clk.h clk: test: Forward-declare struct of_phandle_args in kunit/clk.h 2025-05-06 14:50:01 -07:00
device.h kunit: Add APIs for managing devices 2023-12-18 13:28:08 -07:00
of.h of: kunit: Extract some overlay boiler plate into macros 2024-10-09 16:25:32 -07:00
platform_device.h kunit: platform: Resolve 'struct completion' warning 2025-01-11 16:00:36 -07:00
resource.h treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
run-in-irq-context.h kunit: irq: Ensure timer doesn't fire too frequently 2026-02-24 14:44:21 -08:00
skbuff.h kunit: skb: add gfp to kernel doc for kunit_zalloc_skb() 2024-11-19 14:52:17 -07:00
static_stub.h kunit: Allow passing function pointer to kunit_activate_static_stub() 2024-01-03 09:06:52 -07:00
test-bug.h kunit: test-bug.h: include stddef.h for NULL 2023-07-18 15:38:13 -06:00
test.h kunit: Protect KUNIT_BINARY_STR_ASSERTION against ERR_PTR values 2026-01-05 15:32:03 -07:00
try-catch.h kunit: Adjust kunit_test timeout based on test_{suite,case} speed 2025-06-24 20:47:39 -06:00
visibility.h module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00