【发布时间】:2021-09-30 07:35:17
【问题描述】:
我正在编写一个类似于 uio 的字符设备。 https://elixir.bootlin.com/linux/latest/source/drivers/uio/uio.c 。我看到进程在轮询文件操作中被poll_wait() 置于睡眠状态,并在发生中断时唤醒wake_up_interruptible()。我不明白 wait 和 wake_up 调用是如何同步的。
考虑这种情况。
poll() 系统调用在用户空间完成。
uio_poll() 被执行。
就在poll_wait() 之前,发生中断,wake_up_interruptible() 完成。
现在poll_wait() 被执行了。
如果没有进一步的中断,poll() 呼叫是否有可能永远被阻塞?
【问题讨论】:
标签: c linux-kernel kernel-module