Subject: Re: Jerky/frozen mouse under load
To: None <netbsd-users@netbsd.org>
From: None <sigsegv@rambler.ru>
List: netbsd-users
Date: 02/13/2005 17:52:19
Jakub Misak wrote:
> OK. I did it, with the options your suggested.
> 
> I think it's a bit better now. Not too much, I'm not quite sure... It's 
> hard to say.
> 
> But what's interesting is that with HZ=1000, things are now much more 
> CPU-hungry. This is the effect that I noticed in Linux 2.6,too when they 
> switched to 1000 Hz from 100 in 2.4 - even though they said that the 
> overhead of 1000 HZ shoud be negligible. Basic tasks now eat much more 
> CPU (if the CPU meters are correct). Keyboard input - when I press a key 
> in a text editor and hold it with autorepeat, the CPU used to stay more 
> or less at 0 % with 100 Hz. But with 1000 Hz, it is now 20-30 %. Or even 
> if I type something quickly. Or cycle through the GUI widgets, using a 
> keyboard with autorepeat, again it's 0-1 % (100 Hz) vs. 20 % (1000)... 
> Why is that? Is the CPU meter wrong? Is the overhead of 1000 Hz really 
> so drastic?
> 

I'm not really an expert on this, but here is what I think:

setting HZ will set system clock to that frequency, so instead of 
scheduling processes for execution 100 times per second, it will 
schedule 1000 times per second. This does increase CPU usage, but if you 
have a lot of tasks running it will allow more tasks to execute per second.