Hi folks
recently I did a personal research. I built three different kernel image
(based on 2.6.17-mm6). Each is built using HZ=100, HZ=250 and HZ=1000.
I enabled the full preemption and BKL preemption:
CONFIG_PREEMPT=y
CONFIG_PREEMPT_BKL=y
Booting those kernels, I ran simple tests. One was a simple loop
calculating division between two random long ints, the other one was
playing a MP3 file using mpg123 version 0.59r. The results were:
$ time loop
------------------------------------------------------------------------
HZ=100 HZ=250 HZ=1000
Real 319.326 317.786 319.072
User 319.33 317.801 319.094
System 0 0.001 0
------------------------------------------------------------------------
Table 1. Loop test result (time in seconds)
$ time mpg123 <mp3 file>
------------------------------------------------------------------------
HZ=100 HZ=250 HZ=1000
Real 270.881 270.89 270.884
User 1.877 1.889 1.895
System 0.067 0.068 0.062
------------------------------------------------------------------------
Specificly for mp3 playback, can I conclude that HZ=100 is still the
best choice to reduce audio latency as much as we can?
And for this kind of test, do I need to generate additional
(background?) load such as by running xruns?
I don't think you can measure audio latency that way. Also, I think that if a system is under heavy load, the higher your HZ the better will be your latency simply because the audio application will be scheduled to run at much smaller timescales. All this depends a lot on the audio application too... actually, to think of it, audio latency is a pretty complex topic :)
Ritesh
Feedbacks are welcome...
regards,
Mulyadi
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/