0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

PRI,NI 優先度

Posted at

ps -eo 項目指定型

PRIは140段階ある。低0→高139
NIは40段階ある。高-20→低19
PRIの優先度が低い部分の40段階(低0→高39)にNI(高-20→低19)が割り当てられている。

[linuxstudy@xxxx ~]$ ps -eo pid,pri,ni,comm | grep -e systemd -e migration -e PRI -e tracker-extract
   PID PRI  NI COMMAND
     1  19   0 systemd          //          PRI:19, NI:0
     7 139   - migration/0      //優先度MAX。PRI:139
    13 139   - migration/1
   544  19   0 systemd-journal
   582  19   0 systemd-udevd
   845  19   0 systemd-logind
  2828   0  19 tracker-extract    //優先度MIN。PRI:0, NI:19

ps -el 詳細情報

PRIは140段階ある。高-40→低99
NIは40段階ある。高-20→低19
PRIの優先度が低い部分の40段階(高60→低99)にNI(高-20→低19)が割り当てられている。

[linuxstudy@xxxx ~]$ ps -el | grep -e systemd -e migration -e PRI -e tracker-extract
F S   UID    PID   PPID  C PRI  NI ADDR SZ WCHAN  TTY          TIME CMD
4 S     0      1      0  0  80   0 - 32102 ep_pol ?        00:00:12 systemd        //          PRI:80, NI:0
1 S     0      7      2  0 -40   - -     0 smpboo ?        00:00:00 migration/0    //優先度MAX。PRI:-40
1 S     0     13      2  0 -40   - -     0 smpboo ?        00:00:00 migration/1
4 S     0    544      1  0  80   0 -  9859 ep_pol ?        00:00:06 systemd-journal
4 S     0    582      1  0  80   0 - 12520 ep_pol ?        00:00:01 systemd-udevd
4 S     0    845      1  0  80   0 -  6607 ep_pol ?        00:00:02 systemd-logind
0 S  1000   2828   2298  0  99  19 - 203854 poll_s ?       00:00:14 tracker-extract      //優先度MIN。PRI:99, NI:19

感想

表示フォーマットを変えると、PRIの意味が変わるのが、とてもわかりにくいと感じる。。
仕事でpsコマンドを使いなれている人はどちらを好むのだろう。。。
なお、カーネル内部の優先度は140段階で、高0→低139の模様。。。。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?