Softirq of Linux Kernel

* not allow execute nest but can recusive lock:local_bh_disable
current->preemt_count + SOFIRQ_OFFSET also disable preempt current process.
* hardirq on, can’t sleep
* not percpu

tasklet and kernel timer is based on softirq

新增softirq, 是要重新编译内核的, 试试tasklet也不错.
* First of all, it’s a conglomerate of mostly unrelated jobs,
which run in the context of a randomly chosen victim
w/o the ability to put any control on them. –Thomas Gleixner

tasklet different with other softirq is run signal cpu core
spinlock_bh wider then spinlock

###time of softirq
* follow hardirq, irq_exit()
* re-enables softirq, local_bh_enable/spin_unlock_bh(); explicity checks executes, netstack/blockIO.
* ksoftirqd

tasklet like a workqueue, sofirq like kthread. that is wonderful, does it?
tasklet 被__tasklet_schedule到某个cpu的percu 变量tasklet_vec.tail上保证了

##When to save irq rather than just disable irq
local_irq_disable() used in the code path that never disabled interrupts.
local_irq_save(flags) used in the code path that already disabled interrupts.

##what about irq nested?

Deal PF_MEMALLOC in softirq