Re: [Patch] Re: Nasty suprise with uptime

Ton Hospel (linux-kernel@ton.iguana.be)
Sun, 4 Nov 2001 18:31:33 +0000 (UTC)


Another way is to have jiffies still be a normal 32-bit counter, and have
another 32 bit value (high_jiffy) whose low bit is supposed to be equal to
the hight bit of the jiffy value. Set up a timer to repeatedly but rarely
check the high bit of jiffy and if it's different from the low bit of
high_jiffy, increase high_jiffy by one. In the rare cases you need to read
the full 64-bit (or rather, 63-bit) value, do the same test and combine the
two parts dropping one bit in the middle. (high_jiffy access would be locked)

This makes 63-bit read slow, but lets normal jiffy ops proceed at
normal speed. in fact, this method can be used to make any 32-bit counter
into a big counter without real speed loss if full length reads are rare
-
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/