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
> http://sourceforge.net/projects/ext2resize/
> http://www-mddsp.enel.ucalgary.ca/People/adilger/
-- George george@mvista.com High-res-timers: http://sourceforge.net/projects/high-res-timers/ Real time sched: http://sourceforge.net/projects/rtsched/ - 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/