Can an interrupt handler be preempted by the same interrupt handler?

后端 未结 5 1991
小蘑菇
小蘑菇 2020-12-15 13:06

Does the CPU disable all interrupts on local CPU before calling the interrupt handler? Or does it only disable that particular interrupt line, which is being served?

5条回答
  •  一生所求
    2020-12-15 13:20

    Yes, that's fine. I'd like to also add what I think might be relevant.

    In many real-world drivers/kernel code, "bottom-half" (bh) handlers are used pretty often- tasklets, softirqs. These bh's run in interrupt context and can run in parallel with their top-half (th) handlers on SMP (esp softirq's).

    Of course, recently there's a move (mainly code migrated from the PREEMPT_RT project) towards mainline, that essentially gets rid of the 'bh' mechanism- all interrupt handlers will run with all interrupts disabled. Not only that, handlers are (can be) converted to kernel threads- these are the so-called "threaded" interrupt handlers.

    As of today, the choice is still left to the developer- you can use the 'traditional' th/bh style or the threaded style.

    Ref and Details:

    http://lwn.net/Articles/380931/

    http://lwn.net/Articles/302043/

提交回复
热议问题