Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Sep 2009 14:13:03 +0200
From:      Pieter de Goeje <>
Cc:        Agus <>
Subject:   Re: Polling and kern.hz
Message-ID:  <>
In-Reply-To: <>
References:  <>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On Saturday 19 September 2009, Agus wrote:
> Hi guys...
> Im reading ant playing with polling and kernel..... I read that
> polling increase net performance and i plan on using it... Now the
> question that arises is.. is polling and performance in general
> affected by the value of kern.hz? i have put in /boot.loader.con
> kern.hz=50 and was wondering if this number affects the number i
> choose for the polling options
> I wanna recompile kernel using
>  options HZ=1000
> So that 1000hz how affects the system? if it affects it at all........
> thanks for anyone who can give me a hint....
> Cheers,
> A

To quote polling(4):
"Device polling disables interrupts by polling devices at appropriate
times, i.e., on clock interrupts and within the idle loop.  This way, the
context switch overhead is removed.  Furthermore, the operating system
can control accurately how much work to spend in handling device events,
and thus prevent livelock by reserving some amount of CPU to other tasks."

HZ affects how often the device is polled. For high bandwidth situations, it 
is important that the latency is kept as low as possible. That means that you 
must poll the device as often as possible. So generally people use very high 
HZ values for polling, for example 10000. HZ=50 leads to latencies of about 
20ms, way too high for normal network I/O.

Note that you can change HZ without recompiling by specifying kern.hz="###" in 

Pieter de Goeje

Want to link to this message? Use this URL: <>