While Linux interrupt handling, To perform "bottom half", There are couple of methods used as below.
- Tasklet
- It can not sleep.
- It run in software interrupt context
- These are atomic. These are guaranteed to never run on more than one CPU of a given processor, for a given tasklet. In other terms they do not run concurrent, (If you have multiple different tasklet in single driver then they can run concurrent)
- They may be scheduled to run multiple times, but tasklet scheduling is not cumulative; the tasklet runs only once, even if it is requested repeatedly before it is launched
- However, another interrupt can certainly be delivered while the tasklet is running, so locking between the tasklet and the interrupt handler may still be required
- Tasklets can be statically allocated using
DECLARE_TASKLET(name, func, data)
or can also be allocated dynamically and initialized at runtime usingtasklet_init(name, func, data)
Tasklets are actually run from a softirq