2
votes

I have been meticulously reading the book named Linux Kernel Development written by Robert Love.

In my understanding, softirqs and tasklets are run in the interrupt context. Also, ksoftirqd is a kernel thread which runs in the process context. So, I find it quite puzzling and difficult to think how ksoftirqd (process context) is employed in order to run softirqs (interrupt context).

1
@harmic That question does not have an answer for ksoftirqd's context.CL.

1 Answers

3
votes

I had similar question on my mind while reading the book, here is a link which should clarify some things: refer to this papar

"ksoftirqd is implemented as a set of threads, each of which is constrained to only run on a specific CPU. They are scheduled (at a very high priority) by the normal task scheduler. This implementation has the advantage that the time spent executing the bottom halves is accounted to a system task. It is thus possible for the user to see that the machine is overloaded with interrupt processing, and maybe take remedial action.

Although the work is now being done in process context rather than bottom half context, ksoftirqd sets up an environment identical to that found in bottom half context. Specifically, it executes the softirq handlers with local interrupts enabled and bottom halves disabled locally. Code which runs as a bottom half does not need to change for ksoftirqd to run it."