- 论坛徽章:
- 0
|
原帖由 grep_one 于 2007-5-7 16:10 发表于 1楼
问题描述:
application A, B共用模块C, C的主要功能:查找,挂载,卸载usb设备,该模块用脚本实现。
A和B都是先fork一个进程,然后执行(exec*)C模块,整个流程没什么区别,但C模块在A中
工作很好,在B中 ...
LKD上面第三章讲进程那儿写的
TASK_UNINTERRUPTIBLE This state is identical to TASK_INTERRUPTIBLE except that it does not wake up and become runnable if it receives a signal. This is used in situations where the process must wait without interruption or when the event is expected to occur quite quickly. Because the task does not respond to signals in this state, TASK_UNINTERRUPTIBLE is less often used than TASK_INTERRUPTIBLE
This is why you have those dreaded unkillable processes with state D in ps(1). Because the task will not respond to signals, you cannot send it a SIGKILL signal. Further, even if you could terminate the task, it would not be wise as the task is supposedly in the middle of an important operation and may hold a semaphore.
也就是说你的进程现在是uninterruptible sleep状态,这个状态是不能够被信号所中断的,所以说你的rmmod不能成功.
解决方法是你在睡眠的时候不要调用uninterruptible_sleep()这一系列的函数,而调用interruptible_sleep()这一类函数. |
|