- 论坛徽章:
- 0
|
在看ldd3,第6章,有个问题请教。
摘录:
Normally, a process that is awakened may preempt the current process and be
scheduled into the processor before wake_up returns. In other words, a call to
wake_up may not be atomic. If the process calling wake_up is running in an
atomic context (it holds a spinlock, for example, or is an interrupt handler), this
rescheduling does not happen.
这里说,wake_up返回之前,就可能有进程切换,除非占用了spinlock或者在中断处理程序中。
我的问题:
1. 在try_to_wake_up()中,只是设置了TIF_NEED_RESCHED标志,那真正调用schedule()是在什么时候?
如果在单处理器,非抢占内核下,是不是肯定会等到wake_up结束,才有调度?
2. 内核是怎么做到:如果在中断处理程序中调用了wake_up,是不会进行调度的。我看2.6的schedule()函数中,也没有
代码在判断是不是在中断处理中。
问题写的有点乱,因为是新手,脑子里本来就比较糊涂,所以问的不清楚。
如果觉得我哪里写的不清楚,请指出来,我改正。 |
|