Clock Problems

Mike McCarty Mike.McCarty at
Tue Dec 15 10:48:33 PST 2009

linux fan wrote:
> On 12/14/09, Bruce Dubbs wrote:
>> Try the fix Ken suggested (CONFIG_HZ_100) and make sure you turn off the
>> SMP option.  That has a lot of extra code you don't need.
> Is there a way to 'nice' the build so that it doesn't use all 100% cpu?

The build isn't the issue. He's losing time while running what he built.

> Does the clock moving only a tick or two during the entire build break it?

Again, it isn't the build which is his problem, it's the system which
gets built losing time on his hardware.

The problem is likely the time consumed by the kernel during context
switching. There are critical regions during which interrupts must be
disabled. It is possible that these periods last more than one
millisecond on a slow machine. So, each time there is a context switch,
we "lose" one interrupt if the interrupts are coming in at 1000 per
second. When the system is "idle" context switching takes place
"infrequently", whereas when the system is "busy" context switching
takes place more frequently. I've read that the 2.6 kernel tries to
"figure out" how many interrupts have been missed.

I've never seen a non real time kernel do a very good job of managing
time schedules like quickly arriving interrupts. If you don't start
out to design a real time system, then its hard to retrofit it. The
issue is not that the code is written badly, it's that the design won't
work for real time. You can't fix problems in design by recoding.
You have to redesign. It's not just that the code isn't fast enough.
Good real time doesn't necessarily require tight code. It does require
good design, however. Different algorithms are used for RTOS than
those in non RTOS.

In fact, one may trade off efficiency in the algorithm for
predictability of run time. The "usual" time consumed may
be greater in a real time algorithm, but the "worst case"
is predictable, so one can guarantee that one hits his time

Oppose globalization and One World Governments like the UN.
This message made from 100% recycled bits.
You have found the bank of Larn.
I speak only for myself, and I am unanimous in that!

More information about the lfs-support mailing list