Robert Love Explains Variable HZ
An anonymous reader writes "Robert Love, author of the kernel preemption patch for Linux, has backported a new performancing boosting patch from the 2.5 development kernel to the 2.4 stable kernel. This patch allows one to tune the frequency of the timer interrupt, defined in 2.4 as "HZ=100". Robert explains 'The timer interrupt is at the heart of the system. Everything lives and dies based on it. Its period is basically the granularity of the system: timers hit on 10ms intervals, timeslices come due at 10ms intervals, etc.' The 2.5 kernel has bumped the HZ value up to 1000, boosting performance."
An overclockable operating system. You wouldn't believe how long I've waited for this. Now where do I get a software heatsink?
To make a long story short, for number crunching machines, servers, and other applications which don't need much user interaction, larger timeslices are preferable because it doesn't matter how responsive the user interface is. For desktop systems, the timeslice can be decreased to improve the responsiveness of the user interface and give a better "feel" to the system at the expense of a minor performance loss. Being able to tune these parameters to meet your needs is one of Linux's great strengths.
I tried recompiling the stock RedHat kernel, and sure enough that was a on option in there to increase the hz for the internal timer.
Slashdot: Where people pretend to be twice as smart as they really are by behaving like children.
The reason is that across a scheduling tick the processors cache gets flushed and reloaded. This means that you end up doing a burst of memory reads, and that will dominate if the clock tick is too short.
-WolfWithoutAClause
"Gravity is only a theory, not a fact!"All of them AFAIK.
That just doesn't sound right.
Well, it is. Deal ;-)
The problem occurs when the memory management unit gets modified to maintain the virtual memory 'illusion'. Then you have to flush the caches to maintain consistency. Of course it doesn't happen on every clock tick, you hope.
That means that all the caches above the memory management unit need to get flushed. This includes the program cache; and any other data too.
I did a quick check on the web for this, but I haven't managed to find a good reference to where the MMU is placed in the different architectures yet.
Anyway, that's one of the main reasons the OS scheduling isn't shorter, but any decent OS has to do quite a bit of dorking around at that time.
-WolfWithoutAClause
"Gravity is only a theory, not a fact!"That's not true. The kernel still reports HZ=100 to userspace, and as far as jiffies calculation concern toward userspace, nothing has changed.
0x2b or not 0x2b, the answer is -1