<br><div>Im trying to do a little benchmarking of perl, and have patched its distro files</div><div>to run perl's times() function on each of the ~1900 test files.</div><div>perl's times() uses man 2 times internally, which I presume reduces to a system-call</div>
<div><br></div><div>The standard distro can be run as: HARNESS_TIMER=1 make test</div><div>but this counts only wall-clock time, and is thus sensitive to system load.</div><div>times does better, </div><div><br></div><div>
Anyway, the 1st thing I noticed on the times numbers was that they all have 10ms granularity.</div><div><br></div><div>This agrees with sysconf granularity :</div><div><div>$ getconf CLK_TCK</div><div>100</div></div><div>
<br></div><div>but not with linux kernel HZ:</div><div>$ grep _HZ /boot/config-`uname -r`</div><div>CONFIG_RCU_FAST_NO_HZ=y</div><div>CONFIG_NO_HZ=y</div><div># CONFIG_HZ_100 is not set</div><div># CONFIG_HZ_250 is not set</div>
<div># CONFIG_HZ_300 is not set</div><div>CONFIG_HZ_1000=y</div><div>CONFIG_HZ=1000</div><div><br></div><div>Confusingly, man 2 times says :</div><div><div>NOTES</div><div> The number of clock ticks per second can be obtained using:</div>
<div><br></div><div> sysconf(_SC_CLK_TCK);</div><div><br></div><div> In POSIX.1-1996 the symbol CLK_TCK (defined in <time.h>) is mentioned</div><div> as obsolescent. It is obsolete now.</div>
</div><div><br></div><div>but linux (fedora 13) seems to disagree :</div><div><br></div><div>$ getconf _SC_CLK_TCK</div><div><div>getconf: Unrecognized variable `_SC_CLK_TCK'</div></div><div><br></div><div><br></div>
<div>
So, the Questions:</div><div><br></div><div>Why arent they the same ? or what am I missing wrt </div><div>the relationship between sysconf(CLK_TCK) and kernel HZ ?</div><div><br></div><div>Is it possible to coax the kernel into counting times in 1ms via some cmd-line option ?</div>
<div>I searched Documentation/kernel-parameters.txt, found nothing.</div><div><br></div><div>is it possible to compile kernel with different HZ options to get the 1ms resolution ?</div><div><br></div><div>Why doesnt times() also count IO-wait states for a process (and children) ?</div>
<div>I note that top reports it (as a system-wide measure)</div><div>and System Monitor 2.30.0 displays it (same system-wide measure)</div><div><br></div><div>hypothetically, if IO-wait numbers were collected by times </div>
<div>(API/ABI change, so never gonna happen) would it be able to reveal anything ?</div><div>Id expect it to show measure disk activity due to the process, and arguably be </div><div>sensitive to system load, unlike user, sys, child-user, child-sys numbers</div>
<div>but it still sounds useful.</div><div><br></div><div>Could process specific IO-wait numbers reveal anything about cache performance ?</div><div><br></div><div>Do cache misses contribute to IO-wait, or do they get counted in other ways ?</div>
<div><br></div>