Linux 系统 ps 命令查看到的 R Z D Sl S+ Ss S< 进程状态的意思

通过 ps aux 命令可以查看到进程类似如下的状态信息

[zyq@zyq ~]$ ps aux   
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.1  0.0 191256  4400 ?        Ss   08:41   0:06 /usr/lib/systemd/systemd --switched-root --system --deserialize 21
root         2  0.0  0.0      0     0 ?        S    08:41   0:00 [kthreadd]
root         3  0.0  0.0      0     0 ?        S    08:41   0:00 [ksoftirqd/0]
root         4  0.0  0.0      0     0 ?        S    08:41   0:00 [kworker/0:0]
root         5  0.0  0.0      0     0 ?        S<   08:41   0:00 [kworker/0:0H]
root        13  0.0  0.0      0     0 ?        S    08:41   0:00 [ksoftirqd/1]
root        14  0.0  0.0      0     0 ?        S    08:41   0:00 [kworker/1:0]
root        15  0.0  0.0      0     0 ?        S<   08:41   0:00 [kworker/1:0H]
root        16  0.0  0.0      0     0 ?        S    08:41   0:00 [watchdog/2]
root      3687  0.0  0.0      0     0 ?        S    15:46   0:00 [kworker/0:0]
root      3733  0.0  0.0      0     0 ?        S<   15:50   0:00 [kworker/0:2H]
root      3746  0.0  0.0   4160   388 pts/0    D    15:51   0:00 ./vfork
root      3747  0.0  0.0      0     0 pts/0    Z    15:51   0:00 [vfork] <defunct>
root      3748  0.0  0.0      0     0 ?        R    15:51   0:00 [kworker/0:2]
root      3749  0.0  0.0      0     0 pts/0    Z    15:51   0:00 [vfork] <defunct>
root      3750  0.0  0.0      0     0 pts/0    Z    15:51   0:00 [vfork] <defunct>
root      3752  0.0  0.0      0     0 pts/0    Z    15:51   0:00 [vfork] <defunct>
root      3415  0.0  0.1 301908 38056 tty1     Ssl+ 08:41   0:00 /usr/bin/X :0 -background none -noreset -audit 4 -verbose -auth /run/gdm/auth-for-gdm-GmQpgS/database -seat seat0 -nolisten tcp vt1
root      3427  0.0  0.0 252916  6448 ?        Sl   08:41   0:00 gdm-session-worker [pam/gdm-launch-environment]
gdm       3431  0.0  0.0 576152 10184 ?        Ssl  08:41   0:00 /usr/libexec/gnome-session-binary --autostart /usr/share/gdm/greeter/autostart
gdm       3438  0.0  0.0  54604   936 ?        S    08:41   0:00 dbus-launch --autolaunch ac0f842592ed4b73962f2acd4d3c35b8 --binary-syntax --c

那 STAT 这一列分别每一个参数具体都代表什么意思呢?

通过 man ps 可以查询到以下信息

PROCESS STATE CODES

       Here are the different values that the s, stat and state output specifiers (header "STAT" or "S") will display to describe the state of a process:

               D    uninterruptible sleep (usually IO)
               R    running or runnable (on run queue)
               S    interruptible sleep (waiting for an event to complete)
               T    stopped by job control signal
               t    stopped by debugger during the tracing
               W    paging (not valid since the 2.6.xx kernel)
               X    dead (should never be seen)
               Z    defunct ("zombie") process, terminated but not reaped by its parent

       For BSD formats and when the stat keyword is used, additional characters may be displayed:

               <    high-priority (not nice to other users)
               N    low-priority (nice to other users)
               L    has pages locked into memory (for real-time and custom IO)
               s    is a session leader
               l    is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)
               +    is in the foreground process group

D 状态与 S 状态的区别

D 状态通常是等待一个 IO 中断才能将此进程唤醒,不可以通过信号将这个进程唤醒,如果系统中有大量 D 状态的进程,说明此计算机磁盘或者网络 IO 比较繁忙,而 S 状态是可以被信号唤醒的状态,这两种状态的进程位于同一个等待队列上,都是在等待某一个事件而不能运行。

僵尸进程与孤儿进程

僵尸进程就是死了但是又没有完全死,孤儿进程就是亲爹死了,但是党和政府不会坐视不管,给孤儿安排个后爹。详情请参考 僵尸进程与孤儿进程_zyqash的博客-CSDN博客

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值