]> Git Repo - linux.git/commitdiff
selftests/livepatch: wait for atomic replace to occur
authorRyan Sullivan <[email protected]>
Thu, 22 Aug 2024 17:31:22 +0000 (13:31 -0400)
committerPetr Mladek <[email protected]>
Mon, 26 Aug 2024 12:52:25 +0000 (14:52 +0200)
On some machines with a large number of CPUs there is a sizable delay
between an atomic replace occurring and when sysfs updates accordingly.
This fix uses 'loop_until' to wait for the atomic replace to unload all
previous livepatches.

Reported-by: CKI Project <[email protected]>
Closes: https://datawarehouse.cki-project.org/kcidb/tests/redhat:1413102084-x86_64-kernel_upt_28
Signed-off-by: Ryan Sullivan <[email protected]>
Reviewed-by: Petr Mladek <[email protected]>
Acked-by: Joe Lawrence <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Petr Mladek <[email protected]>
tools/testing/selftests/livepatch/test-livepatch.sh

index 65c9c058458de87d5bcfa515fac363ef253ed65d..bd13257bfdfe51ec846884bf25773a0684f65a59 100755 (executable)
@@ -139,11 +139,8 @@ load_lp $MOD_REPLACE replace=1
 grep 'live patched' /proc/cmdline > /dev/kmsg
 grep 'live patched' /proc/meminfo > /dev/kmsg
 
-mods=(/sys/kernel/livepatch/*)
-nmods=${#mods[@]}
-if [ "$nmods" -ne 1 ]; then
-       die "Expecting only one moduled listed, found $nmods"
-fi
+loop_until 'mods=(/sys/kernel/livepatch/*); nmods=${#mods[@]}; [[ "$nmods" -eq 1 ]]' ||
+        die "Expecting only one moduled listed, found $nmods"
 
 # These modules were disabled by the atomic replace
 for mod in $MOD_LIVEPATCH3 $MOD_LIVEPATCH2 $MOD_LIVEPATCH1; do
This page took 0.054699 seconds and 4 git commands to generate.