认识进程状态 PROCESS STATE CODES


一、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, either by a job control signal or because it is being traced.
       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 无法中断的休眠状态(通常 IO 的进程);
R 正在运行可中在队列中可过行的;
S 处于休眠状态;
T 停止或被追踪;
W 进入内存交换(从内核2.6开始无效);
X 死掉的进程 ;
Z 僵尸进程;

< 优先级高的进程
N 优先级较低的进程
L 有些页被锁进内存;
s 进程的领导者(在它之下有子进程);
l 多进程的(使用 CLONE_THREAD, 类似 NPTL pthreads);
+ 位于后台的进程组;

二、举个例子

ps -aux |  more
USER        PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root          1  0.0  0.0  59184  7500 ?        Ss   Feb11 106:15 /usr/lib/systemd/testsystemd --switched-root --system --deserialize 22
root          2  0.0  0.0      0     0 ?        S    Feb11   0:14 [testkthreadd]
root          3  0.0  0.0      0     0 ?        S    Feb11   8:08 [testksoftirqd/0]
root          5  0.0  0.0      0     0 ?        S<   Feb11   0:00 [testkworker/0:0H]
root          8  0.0  0.0      0     0 ?        S    Feb11   6:34 [testmigration/0]
root          9  0.0  0.0      0     0 ?        S    Feb11   0:00 [testrcu_bh]
root         10  0.0  0.0      0     0 ?        S    Feb11 242:57 [testrcu_sched]
root       3232  0.0  0.0      0     0 ?        SN   Feb11  29:09 [testkipmi0]
root       3321  0.0  0.0  98652   876 ?        Ssl  Feb11   0:12 /usr/sbin/testproxy -D
test     4121  2.6  0.0      0     0 ?        Zsl  Sep09 3935:10 [testsvr] <defunct>
root      24634  0.0  0.0      0     0 ?        D    Dec11   0:00 [kworker/6:10]
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值