lkml.org 
[lkml]   [1999]   [Feb]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: How to read xtime
On Thu, 25 Feb 1999, David Miller wrote:

>retry: ldd [xtime], %reg1 /* load all 8 bytes of xtime */
> ld [timer_reg], %reg2 /* snapshot timer counter */
> ldd [xtime], %reg3 /* load second copy of xtime */
> cmp %reg1, %reg3 /* Did it change in between? */
> bne retry /* Yep, try once more */
> nop
^^^^ RISC pipeline ;)

>
>No locks, no interrupt disabling, etc. I suppose using this technique
>would be extremely troublesome if the architecture in question has no
>method to load an aligned doublet of time_t's at once. But I believe
>ix86 actually can.

I am not sure we are talking about the same thing, but time_t is a 32bit
on i386. While xtime is a 64 bit (it has both time_t and the suseconds_t).
If I remeber well only movq (MMX) can move 64 bit at once on i386. But I
don't think the 64 bit thing is the issue.

I think the issue is timer_reg. What is timer_reg? To avoid a xtime_lock
we must make sure that the other CPU is not in the middle of the xtime
updating (so that only half of the xtime struct is been updated).

Van Jacobson is not enough to assure this (I am assuming that timer_reg is
something like `jiffies` on Linux).

Andrea Arcangeli


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:50    [W:0.043 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site