简体   繁体   English

绕过softlockup_threshold

[英]Bypass softlockup_threshold

I develop a kernel module which does a heavy job which of course takes time. 我开发了一个内核模块,它的工作很繁重,这当然需要时间。 The problem is that the module utilizes the CPU for more than 20 seconds and as a result a BUG of softlockup_threshold is raised. 问题在于该模块使用CPU的时间超过20秒,结果是产生了softlockup_threshold的错误。

My question is, is there any way to bypass this? 我的问题是,有什么办法可以绕过这个? ie can it tamper the threshold? 即可以篡改阈值吗? Or can it force scheduling and continue its work later? 还是可以强制调度并在以后继续工作? (in order to set the timer to 0). (以便将计时器设置为0)。

Thank you in advance, Panos 预先感谢您,Panos

With new kernels, you can tune /proc/sys/kernel/watchdog_thresh (Older kernels use /proc/sys/kernel/softlockup_thresh, I think). 使用新内核,您可以调整/ proc / sys / kernel / watchdog_thresh(我认为旧内核使用/ proc / sys / kernel / softlockup_thresh)。 But this is not encouraged, because blocking for 20 seconds means there is some problem with you code, you should yield the CPU, eg by calling cond_resched(). 但是不鼓励这样做,因为阻塞20秒钟意味着您的代码存在一些问题,您应该让CPU产生,例如通过调用cond_resched()。

您可以尝试让CPU产生一段时间,如果可以接受,那么您应该研究一下schedule()这里有一篇很棒的文章,关于内核中的睡眠

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM