简体   繁体   English

在Linux内核模块(驱动程序)关键部分等待用户空间输入

[英]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.

相关问题 在不依赖输入调用的情况下,自动将消息从内核模块发送到用户空间应用程序。 来自用户空间 - Autonomically sending a message from kernel-module to user-space application without relying on the invoke of input. from user-space 如何从 Linux kernel 空间模块执行/调用用户空间定义的 function? - How can I Execute/Call a user-space defined function from Linux kernel space module? 我的 Linux kernel 模块没有收到正确的用户空间应用程序 PID - My Linux kernel module is not receiving the correct User-space Application PID UDP数据包从内核到Linux中用户空间的路径 - Path of the UDP packet from kernel to user-space in Linux 从用户空间进程启用内核模块调试 - Enable debugging of kernel module from user-space process 如何从内核模块扫描用户空间内存 - How to scan user-space memory from a kernel module 在Windows 10驱动程序中将内核空间虚拟地址映射到用户空间虚拟地址 - Mapping Kernel-Space Virtual Address to User-Space Virtual Address in Windows 10 Driver 从内核分配用户空间内存 - allocate user-space memory from kernel 当我们从用户空间调用任何套接字时,内核如何知道要调用哪个驱动程序? - How kernel know which driver to be called when we are calling any socket from user-space? 执行/调用用户空间程序,并从内核模块获取其pid - Execute/invoke user-space program, and get its pid, from a kernel module
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM