Re: linux clock

2004-10-11 Thread Rob van der Heij
On Tue, 12 Oct 2004 08:22:59 +0200, Istvan Nemeth
<[EMAIL PROTECTED]> wrote:

> Who knows how works the system clock in a linux running on a z/800?
>
> On a PC he reads the date and time from the CMOS (once), and then the
> kernel is generating the correct time. But how works this when we are
> running in LPAR mode, and 1 IFL is shared between LPARs? He gets "timer
> interrupt?" always, or when one LPAR is under heavy load the others time
> slows down?

Even on the PC things are happening that prevent the clock update
routine from being notified immediately and always with the same
delay. In addition to the timer interrupt, Linux uses a CPU register
that shows how much time has passed since the last interrupt. This way
Linux can correct for any delay that happened there.

On zSeries we have a Time-of-Day clock (TOD clock) that is read with a
special instruction. This produces the date and time in high
resolution (microseconds). To get the timer tick as on the PC, Linux
for zSeries loads the Clock Comparator with the current date & time
plus 10 mS - to get a timer interrupt in 10 mS.
As you state correctly, with a single CPU you can not have two LPARs
run the timer interrupt handler at the same time. But as outlined
above, that is no problem since we can compute how much time passed
since the time we set the wake-up call. In fact, there is no reason to
assume these wake-up calls would be set at the same time.

And since we can compute how much time passed since the timer
interrupt, there is not even a need to wake up every 10 mS if the only
reason would be to compute how much time has passed...  This is why
Linux for zSeries has the ability not to tick the clock every 10 mS,
but set the timer for the time when we really need to wake up and
correct for the number of missed timer ticks each time we do wake up.
This approach is one of the keys to run a lot of Linux servers on
z/VM.

Rob

Rob van der Heij  rvdheij @ gmail.com

--
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390


linux clock

2004-10-11 Thread Istvan Nemeth
Hi!

Who knows how works the system clock in a linux running on a z/800?

On a PC he reads the date and time from the CMOS (once), and then the
kernel is generating the correct time. But how works this when we are
running in LPAR mode, and 1 IFL is shared between LPARs? He gets "timer
interrupt?" always, or when one LPAR is under heavy load the others time
slows down?


Istvan Nemeth

--
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390