You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have encountered an issue with kpatch where it experiences stalling or timeouts when performing load/unload operations on modules,。
Upon reviewing the kpatch code, I noticed that the method used to check the system interface at /sys/kernel/livepatch/livepatch_diff/transition involved a sleep 1 interval, which seemed to be inefficient or unsuitable for my current working environment. This method appeared to contribute to the stalling or timeouts observed.
To address this, I modified the method in kpatch that checks this interface. My changes have resulted in a significant improvement in the efficiency of module load/unload operations. I believe this modification could be beneficial for others facing similar issues, especially on new architectures.
[root@localhost kpatch]# ./kpatch load ../kpatch-build/livepatch-diff.ko
loading patch module: ../kpatch-build/livepatch-diff.ko
waiting (up to 15 seconds) for patch transition to complete...
patch transition has stalled!
signaling stalled process(es):
waiting (up to 60 seconds) for patch transition to complete...
Stalled processes:
module livepatch_diff did not complete its transition, unloading...
disabling patch module: livepatch_diff
waiting (up to 15 seconds) for patch transition to complete...
transition complete (2 seconds)
unloading patch module: livepatch_diff
kpatch: error: failed to load module livepatch_diff (transition stalled)
[root@localhost kpatch]#
unload module
[root@localhost kpatch]# ./kpatch unload ../kpatch-build/livepatch-diff.ko
disabling patch module: livepatch_diff
waiting (up to 15 seconds) for patch transition to complete...
patch transition has stalled!
signaling stalled process(es):
waiting (up to 60 seconds) for patch transition to complete...
kpatch: transition stalled for livepatch_diff
[root@localhost kpatch]#
By observing the dmesg logs, it can be seen that the module transition time is over 1500 seconds, of course, this time is not fixed, and sometimes it might complete the load/unload in just a few seconds with good luck.
After Applying the Patch
load module
[root@localhost kpatch]# ./kpatch load ../kpatch-build/livepatch-diff.ko
loading patch module: ../kpatch-build/livepatch-diff.ko
waiting (up to 15 seconds) for patch transition to complete...
transition complete (14 seconds)
unload module
[root@localhost kpatch]# ./kpatch unload ../kpatch-build/livepatch-diff.ko
disabling patch module: livepatch_diff
waiting (up to 15 seconds) for patch transition to complete...
transition complete (1 seconds)
unloading patch module: livepatch_diff
[root@localhost kpatch]#
other
If you need me to provide any additional information, please contact me. I would also appreciate it if you could offer me some better solutions.
/cc @oceansue
The text was updated successfully, but these errors were encountered:
Description
I have encountered an issue with
kpatch
where it experiences stalling or timeouts when performing load/unload operations on modules,。Upon reviewing the
kpatch
code, I noticed that the method used to check the system interface at/sys/kernel/livepatch/livepatch_diff/transition
involved asleep 1
interval, which seemed to be inefficient or unsuitable for my current working environment. This method appeared to contribute to the stalling or timeouts observed.To address this, I modified the method in
kpatch
that checks this interface. My changes have resulted in a significant improvement in the efficiency of module load/unload operations. I believe this modification could be beneficial for others facing similar issues, especially on new architectures.Environment
Additional Information
Attachments
Before Applying the Patch
By observing the dmesg logs, it can be seen that the module transition time is over 1500 seconds, of course, this time is not fixed, and sometimes it might complete the load/unload in just a few seconds with good luck.
After Applying the Patch
other
If you need me to provide any additional information, please contact me. I would also appreciate it if you could offer me some better solutions.
/cc @oceansue
The text was updated successfully, but these errors were encountered: