- 论坛徽章:
- 0
|
论坛里有人问vfree(): sleeping in interrupt!!的问题,看了一下vfree的code, 没有发现vfree里有引起sleep的code,想了半天+google也没有发现什么有价值的信息。找到的几个帖子,都是说vfree不能在interrupt context里调用,但是都没有说明为什么?
最后去Linux Kernel Newbies的irc channel(irc.oftc.net #kernelnewbies)去问了一下,有个叫peterz的id回答了我的问题:
Q: Why vfree must not be called in interrupt context?
A: the tlb flushing can deadlock with IRQs disabled as it relies on IPIs
suppose two cpus are in interrupt context (with interrupts disabled),
both then want to vfree which would result in a TLB flush, the TLB flush
will IPI the other cpu to clear its TLB, but the other CPU has interrupts
disabled so both keep waiting for the other to process the TLB flush -> deadlock
btw, 我怀疑peterz就是大牛Peter Zijlstra |
|