Search code examples
linux-kernelscheduled-taskssignalsjobs

which queue dos a paused process resident?


On Linux, when enter Ctrl-Z in a terminal, the foreground process will be stopped, as for the process in kernel, its state is marked as TASK_STOPPED. A sleeping process (in TASK_INTERRUPTIBLE or TASK_UNINTERRUPTIBLE state) is moved to a wait queue in the kernel, where does a process in TASK_STOPPED state resident? I've googled and searched related books a lot, no satisfied answer found. Excuse me for my poor English and Linux skills.


Solution

  • It doesn't get moved anywhere. It remains on a CPU runqueue, and is never selected by the scheduler because its state is TASK_STOPPED.