linux-kernellinux-device-driverirqsoftirq

PID in case of irq context


what does "current->pid" prints in below 2 case

1) Hard IRQ context

2) Soft IRQ context

I know IRQ context and process context are different, and PID must be invalid in case of IRQ context. But when try to print "current->pid" in IRQ context it is printing some valid PID, hence got the doubt. Please clarify.

Thank You,

Gopinath.


Solution

  • It shows just a pid of a process that the IRQ preepmts.

    You can imagine that:

    1. A process whose pid is 1001 is running.
    2. At that time, you press a key to raise an IRQ.
    3. The IRQ handler preempts the process whose current->pid is 1001.

    There is NO RELATIONSHIP between current->pid and the IRQ