top/ps 顯示 priority的問題 - Linux

By George
at 2008-07-24T13:29
at 2008-07-24T13:29
Table of Contents
我使用Ubuntu 8.04LTE
剛剛嘗試使用renice來改process的priority
可是我發現ps與top的結果都怪怪的...
root@test-laptop:/# pid=6415;
root@test-laptop:/#
root@test-laptop:/# renice -20 -p $pid;
6415: old priority 19, new priority -20
root@test-laptop:/# ps -o "pid pri ni" $pid;
PID PRI NI
6415 39 -20
root@test-laptop:/# top -n 1 -p $pid;
top - 01:51:40 up 2:21, 2 users, load average: 0.40, 0.27, 0.27
Tasks: 1 total, 0 running, 1 sleeping, 0 stopped, 0 zombie
Cpu(s): 13.0%us, 2.3%sy, 0.5%ni, 83.4%id, 0.6%wa, 0.1%hi, 0.0%si, 0.0%st
Mem: 2066408k total, 1423656k used, 642752k free, 52852k buffers
Swap: 2000084k total, 0k used, 2000084k free, 821060k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
6415 test 0 -20 337m 179m 27m S 4 8.9 24:07.43 firefox
或者是
root@test-laptop:/# renice 0 -p $pid;
6415: old priority -20, new priority 0
root@test-laptop:/# ps -o "pid pri ni" $pid;
PID PRI NI
6415 19 0
root@test-laptop:/# top -n 1 -p $pid;
top - 01:51:46 up 2:21, 2 users, load average: 0.36, 0.26, 0.27
Tasks: 1 total, 0 running, 1 sleeping, 0 stopped, 0 zombie
Cpu(s): 13.0%us, 2.3%sy, 0.5%ni, 83.4%id, 0.6%wa, 0.1%hi, 0.0%si, 0.0%st
Mem: 2066408k total, 1423716k used, 642692k free, 52860k buffers
Swap: 2000084k total, 0k used, 2000084k free, 821060k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
6415 test 20 0 337m 179m 27m S 10 8.9 24:07.82 firefox
static priority ranging from 100 to 139 (from ULK)
真要說的話,至少top的結果是"正常"的,ps的根本反過來了....
這是bug...還是有什麼道理的呢??
--
Tags:
Linux
All Comments

By Daph Bay
at 2008-07-25T06:26
at 2008-07-25T06:26

By Joseph
at 2008-07-29T09:11
at 2008-07-29T09:11
Related Posts
網站上的flash影片聽不到聲音?

By Rebecca
at 2008-07-24T11:10
at 2008-07-24T11:10
recompile the kernel之後滑鼠不能動

By Dora
at 2008-07-24T01:47
at 2008-07-24T01:47
關於DNS架設問題

By Margaret
at 2008-07-24T00:38
at 2008-07-24T00:38
安裝winxp via pxe

By Yedda
at 2008-07-24T00:14
at 2008-07-24T00:14
DNS named server Port

By Candice
at 2008-07-24T00:12
at 2008-07-24T00:12