From d319ebb6461e793922912f02d8fbcd06212fc81f Mon Sep 17 00:00:00 2001 From: oceansue Date: Sat, 24 Aug 2024 10:24:23 +0800 Subject: [PATCH] kpatch/kpatch: Optimize patch transition timing with a while loop Optimize the timing of patch transitions by using a `while` loop to check the transition status, replacing the `for` loop with a 1-second sleep. This approach reduces the likelihood of timeouts due to system load, potentially speeding up patch transitions. Signed-off-by: oceansue Signed-off-by: Kernel Group --- kpatch/kpatch | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/kpatch/kpatch b/kpatch/kpatch index edfccfead..6c3c95d89 100755 --- a/kpatch/kpatch +++ b/kpatch/kpatch @@ -245,29 +245,31 @@ signal_stalled_processes() { wait_for_patch_transition() { local module="$1" - local i + local i=0 in_transition "$module" || return 0 echo "waiting (up to $POST_ENABLE_WAIT seconds) for patch transition to complete..." - for (( i=0; i