- 论坛徽章:
- 0
|
看了下你的帖子,有一点不太明白,请指教
1)占着 mutex锁,关中断,msleep,
希望kernel 挂掉,但系统运行正常 原因是显式调度,schedule()会打开中断。这个跟抢占没有关系
这里,"schedule()会打开中断"是什么意思?
你是指这段代码吗?,在schedule()中, 我的内核版本是2.6.18
- if (likely(prev != next)) {
- next->timestamp = now;
- rq->nr_switches++;
- rq->curr = next;
- ++*switch_count;
- prepare_task_switch(rq, next);
- prev = context_switch(rq, prev, next);
- barrier();
- /*
- * this_rq must be evaluated again because prev may have moved
- * CPUs since it called schedule(), thus the 'rq' on its stack
- * frame will be invalid.
- */
- finish_task_switch(this_rq(), prev);
- } else
- spin_unlock_irq(&rq->lock);
复制代码
我看了下只有在else中会有打开中断的动作,但一般都不会进这个else吧?
我哪里理解错了呢?请指教。。。 |
|