Re: [Patch] Re: Nasty suprise with uptime

Ton Hospel
2001-11-04T18:32:23Z

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