Softirqs are statically allocated (i.e., defined at compile time), while tasklets can also be
allocated and initialized at runtime (for instance, when loading a kernel module). Softirqs can
run concurrently on several CPUs, even if they are of the same type. Thus, softirqs are reentrant
functions and must explicitly protect their data structures with spin locks. Tasklets do not have
to worry about this, because their execution is controlled more strictly by the kernel. Tasklets
of the same type are always serialized: in other words, the same type of tasklet cannot be executed
by two CPUs at the same time. However, tasklets of different types can be executed concurrently on
several CPUs. Serializing the tasklet simplifies the life of device driver developers, because the
tasklet function needs not be reentrant.
allocated and initialized at runtime (for instance, when loading a kernel module). Softirqs can
run concurrently on several CPUs, even if they are of the same type. Thus, softirqs are reentrant
functions and must explicitly protect their data structures with spin locks. Tasklets do not have
to worry about this, because their execution is controlled more strictly by the kernel. Tasklets
of the same type are always serialized: in other words, the same type of tasklet cannot be executed
by two CPUs at the same time. However, tasklets of different types can be executed concurrently on
several CPUs. Serializing the tasklet simplifies the life of device driver developers, because the
tasklet function needs not be reentrant.