[lkml]   [2002]   [Feb]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [patch][rfc] enable uptime display > 497 days on 32 bit
Andreas Dilger wrote:
> On Feb 26, 2002 11:42 -0800, george anzinger wrote:
> > Well, since you asked (thank you), the high-res-timers patch needs to
> > get the full 64-bit uptime to implement CLOCK_MONOTONIC.
> > This means that the 64-bit jiffies is used "often" in this code.
> > Unlike this patch, it keeps the 64-bit rational (i.e. always current)
> Well, if you use the get_jiffies64() interface the 64-bit value is
> always coherent as well, and the direct access to the 32-bit value
> is monotonic. While the high and low words of the 64-bit jiffies
> values may be incoherent at times, as long as you always access the
> 64-bit value with the get_jiffies64() interface it should be OK.
> Do you think that doing a 64-bit add-with-carry to memory on each
> timer interrupt and doing multiple volatile reads is faster than
> doing a spinlock with an optional 32-bit increment?

I think the memory cycle is "almost" free as we are also updating
jiffies which is in the same cache line, so, yes, in the overall scheme
of things the overhead of the additional add-with-carry is very small.
On the read side of things, the issue is not so much the lock, but the
irq nature of it. This will be VERY long, much longer than the double
load of the high order bits, again from the same cache line.

> Do you think
> there would be a lot of contention on this lock, given that you
> only need to lock when you need the full 64-bit value?

A question that arises is if you can use an independant lock. For the
high-res code, we need to be coherent with the sub-jiffie part also, and
this is all updated in the interrupt code, so the lock, it would seem,
should be the one that is taken there, which is the xtime read/write irq
lock. Again, it is the irq nature of things that is slow.

> Cheers, Andreas
> --
> Andreas Dilger

Real time sched:
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

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