[RFC] Event timers on sparc64/sun4v

Alexander Motin mav at FreeBSD.org
Wed Jul 28 07:26:50 UTC 2010


Marius Strobl wrote:
> On Wed, Jul 21, 2010 at 03:10:35PM +0300, Alexander Motin wrote:
>> Here is updated patch for latest HEAD, which should handle this:
>> http://people.freebsd.org/~mav/timers_sparc4.patch
>>
>> I also added support for STICK timecounter. For this moment with lowest
>> priority to not use it by default, until it is tested.
> 
> The patch looks ok and seems to work as expected on MP US-IIIi.
> However, I'd suggest to just use TICK_QUALITY_{M,U}P for the
> quality of the STICK timecounter but negated for now; I see no
> reason why the STICK timecounter should be of any other quality
> (from the hardware point of view) than the TICK one and whatever
> the solution is to make the TICK timecounter work with locks etc
> also needs to be applied to the STICK one (maybe on some machines
> the synchronicity across CPUs actually happens to be sufficient
> but I'd like to rather not make any assumptions about machines
> that f.e. group CPUs by coherency domain etc).

As you said before, STICK has lower resolution then TICK (though not so
much), so I would set it's quality a bit lower. And it has more chances
to work synchronously then TICK on MP, so I would set it's quality
higher there. I don't actually see the reason for using negative
qualities, unless timers are really broken. In such case if there will
be no other timers, system will fall back to the dummy, which I have
doubts is better then anything else.

> A difference in behavior I noticed is that the TICK interrupt
> rate now is 2kHz (with HZ 1000). Why is that (I think that on
> x86 the timers ran at 2*HZ before though)?

Originally it was x86 behavior for cases when only one timer available.
It was made to slightly separate hardclock and statclock events for
better accounting. I've just reimplemented it in more general way in new
timer infrastructure. It may obsolete later when we start using timers
in one-shot mode it. If you wish, you may disable it now by setting
kern.eventtimer.singlemul=1. Another way is to add support for STICK
event timer. When two timers available, multiplication won't be used.

If you start profiling, frequency should automatically rise to about 8KHz.

-- 
Alexander Motin


More information about the freebsd-sparc64 mailing list