Subject: Re: SMP & ntpd interaction?
To: matthew green <mrg@eterna.com.au>
From: Paul Kranenburg <pk@cs.few.eur.nl>
List: tech-kern
Date: 01/18/2003 13:25:21
>    BTW. it would be nice to have atomic updates of `time' and `mono_time',
>    say, by providing a MD version of `BUMP_TIME()'.  On the sparc, it
>    can use `std' to update the timevals, just like microtime() use
>    `ldd' to read it.
> 
> 
> there's no reason not to do this is there?  mono_time isn't hard but
> time is in the NTP case...  we can simply add an #ifndef BUMPTIME()
> to kern_clock.c and have it defined in <machine/cpu.h> ?  that would
> handle the !NTP case.. perhaps an API change for BUMPTIME() .. have
> it return true if it had to also bump the tv_sec, then the NTP case
> (well.. the "HIGHBALL" case is still not handled..) case would then
> know to perform the additional processing...

All cases could be handled by first making a local copy of the time
value to be modified, update that and store it back into the global
variable. To do this, we need two operations like: ATOMIC_READTIMEVAL
and ATOMIC_WRITETIMEVAL.

Of course, there's also the issue of properly aligning the arguments
you want to pass to these ops.

-pk