|
资料上说是
Number of pageins and pageouts (since the last boot):
pgpgin 33754195
pgpgout 38985992
Number of swapins and swapouts (since the last boot):
pswpin 2473
pswpout 2995
可是Page In 和Swap in 是什么区别呢?
是不是Page In 包括了更多的事件, 从Inactive List 到 Active List等等?
另外,我 看了VMSTAT这个命令的程序:
getstat(cpu_use,cpu_nic,cpu_sys,cpu_idl,cpu_iow,cpu_xxx,cpu_yyy,
pgpgin,pgpgout,pswpin,pswpout,
intr,ctxt,
&running,&blocked,
&dummy_1, &dummy_2);
duse= *cpu_use + *cpu_nic;
dsys= *cpu_sys + *cpu_xxx + *cpu_yyy;
didl= *cpu_idl;
diow= *cpu_iow;
Div= duse+dsys+didl+diow;
divo2= Div/2UL;
printf(format,
running, blocked,
unitConvert(kb_swap_used), unitConvert(kb_main_free),
unitConvert(a_option?kb_inactive:kb_main_buffers),
unitConvert(a_option?kb_active:kb_main_cached),
(unsigned)( (*pswpin * unitConvert(kb_per_page) * hz + divo2) / Div ),
(unsigned)( (*pswpout * unitConvert(kb_per_page) * hz + divo2) / Div ),
(unsigned)( (*pgpgin * hz + divo2) / Div ),
(unsigned)( (*pgpgout * hz + divo2) / Div ),
。。。
其中getstat函数就是从/proc/stat读取从CPU的值,其他从./oproc/vmstat读取。
不理解的是
Div= duse+dsys+didl+diow;
divo2= Div/2UL;
。。。
(unsigned)( (*pswpin * unitConvert(kb_per_page) * hz + divo2) / Div ),
DIV应该是系统自BOOT以来的总的Jiff数吧,可 (x * hz + divo2) / Div是什么意思呢? |
|