Re: [patch][rfc] enable uptime display > 497 days on 32 bit

Andreas Dilger (adilger@turbolabs.com)
Tue, 26 Feb 2002 16:33:23 -0700


On Feb 26, 2002 15:13 -0800, george anzinger wrote:
> Andreas Dilger wrote:
> > 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.

I was wondering about that myself when looking at the code again. I'm
not quite sure why we need to use the irq spinlock, since we already
make a local copy of jiffies so another timer IRQ changing the jiffies
value shouldn't affect the return value of get_jiffies64(). Then again,
that isn't exactly stuff I'm familiar with, so I could be totally
off-base here.

Cheers, Andreas

--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/

- 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/