Linux Process States
At any moment, every process is in one of a handful of states. Reading these states from ps or top is one of the first things you do when diagnosing a problem.
The Process States
| Code | Name | Meaning |
|---|---|---|
| R | Running/Runnable | On CPU, or ready and waiting for CPU time |
| S | Interruptible Sleep | Waiting for event (I/O, timer). Can be woken by signals. |
| D | Uninterruptible Sleep | Waiting for I/O. Cannot be killed — not even SIGKILL. |
| Z | Zombie | Finished, parent hasn't called wait() yet. |
| T | Stopped | Paused by SIGSTOP or Ctrl+Z. Resumes with SIGCONT. |
| I | Idle kernel thread | Similar to D but for kernel threads, truly idle |
S vs D — The Critical Difference
Both S and D are "sleeping" — but they're very different:
Why can't you kill a process in D state?
D (uninterruptible sleep) means the process is in the middle of a critical kernel operation — usually waiting for disk or network I/O at the kernel level. Killing it mid-operation could corrupt data. The kernel ignores SIGKILL in this state. The process will wake up when the I/O completes (or the kernel detects a hang).
Common causes of D state: slow NFS mount, failing disk, kernel bug. If many processes are stuck in D, look for disk issues first:
dmesg | grep -i error
iostat -x 1
iotop
Zombie Processes
What is a zombie process and why does it exist?
When a process exits, it can't fully disappear yet. The parent might need its exit status (return code). So the kernel keeps a minimal "tombstone" — the process table entry with the exit status. This is the zombie state. Once the parent calls
wait(), the zombie is cleaned up.
A few zombies are normal. Thousands of zombies means a parent process is leaking — it's forking children but never calling wait().
# Find zombie processes
ps aux | grep Z
# Find zombie's parent (to fix the real problem)
ps -o ppid= -p ZOMBIE_PID
# Then investigate or restart that parent process
State Modifiers in ps Output
| Modifier | Meaning |
|---|---|
s | Session leader (controls a terminal) |
+ | In the foreground process group |
l | Multi-threaded |
N | Low priority (nice > 0) |
< | High priority (nice < 0) |