Re: Linux timekeeping plans

Colin Plumb (colin@nyx.net)
Thu, 3 Dec 1998 09:48:45 -0700 (MST)


s makes generating a single systemwide clock a bit tricky. Some
>> inter-processor interrupts will definitely be required, but I don't
>> know if I can create a special one for timekeeping purposes.
>> Can I create a broadcast interrupt which all processors use for
>> timekeeping?

> this timekeeping architecture is already in place. The concept is: all
> processors have a 'local' interrupt, which is used for profiling, process
> time accounting and process timeslice rescheduling. And there is a global
> external interrupt that expires timers.

Yes, I have seen this. On the x86, one processor gets the timer tick
and does the tick processing for the system. Then it signals all the
other processors (via an inter-processor interrupt) to do per-processor
scheduling, and falls through itself. (An alternative would be to send an
interrupt to every processor including itself. That might be simpler
on some systems.)

> you can safely assume that there is globally valid TSC on SMP systems.
> (last i checked this was true for all SMP Intel, Alpha and Sparc systems)
> If you use cli/sti you can make any readout of the TSC value and the timer
> tick counter atomic.

Ah, thank you. I'll go ahead with that assumption, comment it clearly,
and get on with it.

I'd still be interested in figuring out ways to solve the pleisochronous
SMP case though, if anyobdy wants to think about it...

-- 
	-Colin

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/