[parisc-linux] [PATCH] timer_interrupt and gettimeoffset.
John David Anglin
dave at hiauly1.hia.nrc.ca
Mon Sep 4 17:52:51 MDT 2006
> + if (likely(now - next_tick < clocktick)) {
> + nticks = 1;
> next_tick += clocktick;
> - nticks++;
> + } else {
> + nticks = ((now - next_tick)/clocktick) + 1;
> + next_tick += clocktick*nticks;
> + }
I'd rather loop if now - next_tick isn't too many ticks. Integer
division and multiplation are very expensive, particularly when
running in 64-bit mode. We don't have optimized millicode to do it.
So, I don't much like falling into the unlikely case if we are just
delayed one tick.
I'm still concerned that we may take a TLB exception in this code
and substantially increase the calculation time.
It's somewhat unclear whether any of these tweaks will solve the
B160 issue. The halftick margin may not be enough in the slow
path at 1000 Hz and decreasing the tick rate may be the only fix
on slow machines.
Dave
--
J. David Anglin dave.anglin at nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)
More information about the parisc-linux
mailing list