[英]Waiting in Linux Kernel Module(Driver) Critical Section for user-space input
I'm new to kernel programming and I was making changes in a Linux Driver. 我是内核编程的新手,并且正在Linux驱动程序中进行更改。 I want to block/wait in a Critical Section for user input(The communication between the Driver and the user-space Application work).
我想在关键部分中阻止/等待用户输入(驱动程序与用户空间应用程序工作之间的通信)。 The Problem is that when I used wait_event_timeout() the System is being crashed and I am getting
BUG: scheduling while atomic: swapper
. 问题是,当我使用wait_event_timeout()时,系统崩溃了,并且我得到了
BUG: scheduling while atomic: swapper
。 Is anybody have any idea how to solve this problem and can give me some advice where to start? 有谁知道如何解决这个问题,可以给我一些建议从哪里开始?
As explained in other questions , you are calling wait_event_timeout in a context when you already have some lock acquired (inside a critical section). 如其他问题所述 ,当您已获取一些锁(在关键部分内)时,您正在上下文中调用wait_event_timeout。 In this point your process can potentially deadlock with other processes and the scheduler complains about it.
在这一点上,您的进程可能会与其他进程陷入僵局,并且调度程序会对此抱怨。 Please, review the point where you are calling wait_event_timeout and check if the I/O is performed in the correct place and if you have unlocked all synchronization primitives before sending your process to sleep.
请检查调用wait_event_timeout的位置,并检查I / O是否在正确的位置执行,以及是否已解锁所有同步原语,然后再将进程发送到睡眠状态。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.