mirror-linux/include
David Gow c31f4aa8fe kunit: Enforce task execution in {soft,hard}irq contexts
The kunit_run_irq_test() helper allows a function to be run in hardirq
and softirq contexts (in addition to the task context). It does this by
running the user-provided function concurrently in the three contexts,
until either a timeout has expired or a number of iterations have
completed in the normal task context.

However, on setups where the initialisation of the hardirq and softirq
contexts (or, indeed, the scheduling of those tasks) is significantly
slower than the function execution, it's possible for that number of
iterations to be exceeded before any runs in irq contexts actually
occur. This occurs with the polyval.test_polyval_preparekey_in_irqs
test, which runs 20000 iterations of the relatively fast preparekey
function, and therefore fails often under many UML, 32-bit arm, m68k and
other environments.

Instead, ensure that the max_iterations limit counts executions in all
three contexts, and requires at least one of each. This will cause the
test to continue iterating until at least the irq contexts have been
tested, or the 1s wall-clock limit has been exceeded. This causes the
test to pass in all of my environments.

In so doing, we also update the task counters to atomic ints, to better
match both the 'int' max_iterations input, and to ensure they are
correctly updated across contexts.

Finally, we also fix a few potential assertion messages to be
less-specific to the original crypto usecases.

Fixes: 950a81224e ("lib/crypto: tests: Add hash-test-template.h and gen-hash-testvecs.py")
Signed-off-by: David Gow <davidgow@google.com>
Link: https://lore.kernel.org/r/20251219085259.1163048-1-davidgow@google.com
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
2025-12-22 12:20:08 -08:00
..
acpi
asm-generic hyperv-next for v6.19 2025-12-09 06:10:17 +09:00
clocksource
crypto This update includes the following changes: 2025-12-03 11:28:38 -08:00
cxl
drm Cross-subsystem Changes: 2025-12-05 10:16:25 +10:00
dt-bindings This pull request is entirely SoC clk drivers, not for lack of trying to modify 2025-12-08 09:38:52 +09:00
hyperv mshv: Add definitions for MSHV sleep state configuration 2025-12-05 23:24:57 +00:00
keys
kunit kunit: Enforce task execution in {soft,hard}irq contexts 2025-12-22 12:20:08 -08:00
kvm
linux Miscellaneous x86 fixes: 2025-12-21 14:41:29 -08:00
math-emu
media
memory
misc
net Including fixes from netfilter and CAN. 2025-12-19 07:55:35 +12:00
pcmcia
ras Significant patch series in this merge are as follows: 2025-12-05 13:52:43 -08:00
rdma
rv rv: Fix compilation if !CONFIG_RV_REACTORS 2025-12-02 12:33:37 -05:00
scsi
soc This pull request is entirely SoC clk drivers, not for lack of trying to modify 2025-12-08 09:38:52 +09:00
sound soundwire updates for 6.19 2025-12-13 16:26:55 +12:00
target
trace Miscellaneous x86 fixes: 2025-12-21 14:41:29 -08:00
uapi Input updates for v6.19-rc1 2025-12-21 15:21:10 -08:00
ufs
vdso
video
xen
Kbuild