Kernel Thread Execution Context and PID
When kernel threads such as ksoftirqdCPU0 or kswapd are scheduled to run, do they run on their own kernel stack or is it whatever kernel stack that happens to be there? Do these kernel threads have their own process descriptors like a user process does?
I've been trying to capture the PID of a kernel thread using the current macro while in a BH of an interrupt handler, expecting to get the PID of ksoftirqd, which is supposed to run any tasklets, but I always get the PID of the user process that was interrupted. If kernel threads have their own process descriptors and in their own kernel stack, shouldn't I be able to get the PID this way? I'm working with Linux 2.6.9 btw.
Thanks for any insight.