Polling and kern.hz
agus.262 at gmail.com
Mon Sep 21 04:07:36 UTC 2009
2009/9/20 Pieter de Goeje <pieter at degoeje.nl>:
> 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 DEVICE_POLLING
>> 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....
> 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
Thanks for the answer... I've been reading and find that i was
confused... i thought that those hz where only for polling but i found
that they are actually for the whole system clock... so now my doubt
is if it will be better to activate polling and leave hz in 1000, or
download hz to lets say 50 so i dont have too many context switches
due to clock interrupts... I will try to test load changing only those
parameters and come back with my results..... If u guys know any perf
tester suitable for this please share..hehe... i will use iperf and
will look for a web perf app.....
More information about the freebsd-questions