0

What happens if a running tasklet is interrupted by a hardware interrupt. I mean if there is a tasklet in the middle of execution and a hardware interrupt happens. Does the tasklet complete its execution before the interrupt code is run, or the tasklet is executed after the interrupt.

Adi s
  • 31
  • 6

2 Answers2

1

Ordinarily a hardware interrupt will be executed immediately. On return, the tasklet will resume execution.

It is possible and even common that a tasklet will disable interrupts during short critical sections while it manipulates shared data structures.

Gil Hamilton
  • 11,973
  • 28
  • 51
  • Does that mean that when a tasklet is interrupted by a hardware interrupt the tasklet state is saved and the tasklet is later resumed from the same state ? – Adi s Jul 07 '15 at 05:41
  • The register context is saved on the current local (kernel) stack. Nothing else is saved and nothing else is switched (i.e. interrupt handler runs on same stack). When the interrupt handler returns, the registers are popped from the stack and the tasklet resumes. – Gil Hamilton Jul 07 '15 at 11:56
0

Taskelts can be interrupted by hardware interrupts. See, e.g this.

Tsyvarev
  • 60,011
  • 17
  • 110
  • 153