Linux

ps輸出中的R/D標誌是什麼意思?

  • March 25, 2019

R / D從是什麼意思ps ax?是否說明有問題?

    3 ?        R    522:45 [ksoftirqd/0]
 4380 ?        Rl   1240:31 gdm-session-worker [pam/gdm-launch-environment]
 5938 ?        Rs     0:00 ps ax
 6148 ?        Rl   1405:54 gnome-shell --mode=gdm

ps手冊中,在“過程狀態程式碼”部分下:

   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

AnR表示程序在執行隊列中。它絕不表示存在問題。

處於某種D狀態的程序不會立即處理信號,因為它目前卡在等待磁碟(通常,這就是程式碼中字母 D 的來源)。如果程序卡住較長時間或多個程序處於相同狀態,這將表明存在問題。問題可能與高 I/O 負載有關(例如,有太多程序想要從太慢的磁碟讀取數據)。

還解釋了附加字元:

對於 BSD 格式和使用 stat 關鍵字時,可能會顯示其他字元:

   <    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

有關的:

引用自:https://unix.stackexchange.com/questions/508576