As we learned with regard to tasklets, a number of points with regard to concurrency must be understood with respect to softirqs:
- As noted with tasklets (on SMP), a tasklet will never run in parallel with itself; this is a feature that makes it easier to use. This isn't true of softirqs: the same softirq vector can indeed run in parallel with itself on another CPU! Thus, the softirq vector code has to be especially careful with the use of locking (and deadlock avoidance).
- A softirq can always be interrupted by a hardirq, including the IRQ that caused it to be raised (this is because, as with tasklets, softirqs run with all interrupts enabled on the local core).
- A softirq cannot preempt another currently executing softirq, even though they have priority levels; they are consumed in priority order.
- The reality is that the kernel provides APIs such as spin_lock_bh(), which allow you to disable softirq processing while the...