Queries on bottom halves

Abhinav Misra abhitheextremeeng at gmail.com
Sun Sep 2 11:28:14 EDT 2018


Hi Larry,

Based on your answers below are my further queries.

1. *Does softirq and tasklet will always runs in ksoftirqd thread context ?*
As it is mentioned in the LKD (by robert love Pg-138) that there are
multiple places where pending softirq's
are checked. Out of that one is in return from hardware interrupt code path
i.e in do_irq function.

If that is the case then it will be running in the irq context with just
the interrupts enabled.
Now I know LKD is old and based on linux kernel 2.6. *Is that above
scenario is changed in new version of kernel ?*

Even I tried one example mentioned in LDD by Jerry cooperstein and printing
the pid of current task (current->pid) in the
tasklet which is getting scheduled by the shared interrupt from n/w card.
Every time it is printing the pid of the ksoftirqd thread.

So does that mean, now in latest kernel, softirq and tasklet will always
run in context of ksoftirqd thread ?

2. If we can sleep or use blocking calls in softirq's and tasklets then
*what is the difference between softirq/tasklet and workqueue's ?*Because
in old kernel, the main difference between softirq/tasklet and workqueue's
(Wq's) is that Wq's runs in process context
and hence sleep is allowed while the same is not the case with other
counterparts.

But if in new kernel this implementation is changed then why we need so
many options to defer the work as all of them are basically getting
executed in almost the same way.* In that case code running softirq,
tasklet, workqueue and kernel thread are all same ?*
If this is true then why we just remove all these these option and keep one
or two alternative.

There's one old link which also talks something about this.
*https://lists.kernelnewbies.org/pipermail/kernelnewbies/2011-November/003812.html
<https://lists.kernelnewbies.org/pipermail/kernelnewbies/2011-November/003812.html>*

BR,Abhinav
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20180902/b0f2f85c/attachment.html>


More information about the Kernelnewbies mailing list