I think you are wondering about the "/", as am I.  Possibly
a while loop, or, something like
fast_gettimeoffset_quotient, but scaled to do jiffies
instead of micro seconds.  Still you SHOULD be doing this so
seldom that one wonders if the "/" is all that bad.
Another thing, possibly not so easily fixed given the
division between "arch" code and common code, but I would
like to see jiffies updated in only ONE place.  With this
patch it is updated in .../kernel/timer.c AND in
.../arch/kernel/time.c.  In the high-res-timers patch I made
the jiffies update an inline in an "arch" header file so I
could have the best of both worlds, i.e. update from common
code using arch resources (TSC, etc).
-g
> 
> diff -Nru a/arch/i386/kernel/time.c b/arch/i386/kernel/time.c
> --- a/arch/i386/kernel/time.c   Thu Jan 30 16:03:19 2003
> +++ b/arch/i386/kernel/time.c   Thu Jan 30 16:03:19 2003
> @@ -657,6 +657,7 @@
>         if(use_cyclone)
>                 mark_timeoffset_cyclone();
>         else if (use_tsc) {
> +               unsigned long delta = last_tsc_low;
>                 /*
>                  * It is important that these two operations happen almost at
>                  * the same time. We do the RDTSC stuff first, since it's
> @@ -700,6 +701,13 @@
>                    momentarily as they flip back to zero */
>                 if (count == LATCH) {
>                         count--;
> +               }
> +
> +               /* lost tick compensation */
> +               delta = last_tsc_low - delta;
> +               if(delta >= 2*loops_per_jiffy){
> +                       delta = (delta/loops_per_jiffy)-1;
> +                       jiffies += delta;
>                 }
> 
>                 count = ((LATCH-1) - count) * TICK_SIZE;
> 
-- George Anzinger george@mvista.com High-res-timers: http://sourceforge.net/projects/high-res-timers/ Preemption patch: http://www.kernel.org/pub/linux/kernel/people/rml - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/