Why kernel code/thread executing in interrupt context cannot sleep?

前端 未结 11 1748
余生分开走
余生分开走 2020-11-30 17:20

I am reading following article by Robert Love

http://www.linuxjournal.com/article/6916

that says

\"...Let\'s discuss the fact that work queues run i

11条回答
  •  臣服心动
    2020-11-30 18:01

    The linux kernel has two ways to allocate interrupt stack. One is on the kernel stack of the interrupted process, the other is a dedicated interrupt stack per CPU. If the interrupt context is saved on the dedicated interrupt stack per CPU, then indeed the interrupt context is completely not associated with any process. The "current" macro will produce an invalid pointer to current running process, since the "current" macro with some architecture are computed with the stack pointer. The stack pointer in the interrupt context may point to the dedicated interrupt stack, not the kernel stack of some process.

提交回复
热议问题