There are a number of APIs that are defined for Tasklet operation in the Linux kernel. The below table provides a list of Tasklet APIs with a brief description of the APIs. For a more comprehensive list – refer /linux/interrupt.h file in the Linux kernel
Tasklet API | Description |
tasklet_init | Initialize the tasklet. Used in dynamic initialization of tasklet |
tasklet_kill | Kill the tasklet instance |
tasklet_schedule | Schedule the tasklet |
tasklet_enable | Enable the tasklet. This function is used after tasklet_disable or if the tasklet is created with DECLARE_TASKLET_DISABLED Macro |
tasklet_disable | Disable the tasklet |
tasklet_hi_schedule | Schedule the tasklet. But the HI_SOFTIRQ is used instead of TASKLET_SOFTIRQ as in the case of tasklet_schedule |
In addition to the above APIs, the “tasklet_init” API is being phased out and the API “tasklet_setup” is being introduced.
In addition to the APIs, the following Macros are also defined which provide static initialization for a tasklet. Even amongst these macros, the earlier MACROS are now marked as OLD and can work with the previous implementation of Tasklet invocation passing “unsigned long” data.
Tasklet MACRO | Description |
DECLARE_TASKLET / DECLARE_TASKLET_OLD | Statically declare a Tasklet |
DECLARE_TASKLET_DISABLED / DECLARE_TASKLET_DISABLED_OLD | Statically declare a Tasklet and disable the tasklet |
Pingback: Tasklets in the Linux kernel | Hitch Hiker's Guide to Learning