Re: [patch] jiffies wraparound [Re: 2.1.125 Show stopper list: Draft]

Finn Arne Gangstad (finnag@guardian.no)
Mon, 19 Oct 1998 18:36:45 +0200 (MEST)


On Mon, 19 Oct 1998, Andrea Arcangeli wrote:

> On Mon, 19 Oct 1998, Finn Arne Gangstad wrote:
>
> >You have to initialise tv1.index .. tv5.index to the correct values if
> >you start with timer_jiffies != 0;
>
> Very good, my guesses was right ;-). Thanks.

I thought some more about it, and the correct values are like this (I
verified this for all 2^32 possible values)

unsigned long j = timer_jiffies - 1;
unsigned int i1 = (1 + j) & TVR_MASK;
unsigned int i2 = (1 + (j >> TVR_BITS)) & TVN_MASK;
unsigned int i3 = (1 + (j >> (TVR_BITS + TVN_BITS))) & TVN_MASK;
unsigned int i4 = (1 + (j >> (TVR_BITS + 2 * TVN_BITS))) & TVN_MASK;
unsigned int i5 = (1 + (j >> (TVR_BITS + 3 * TVN_BITS))) & TVN_MASK;

where i1 is tv1.index, i2 is tv2.index etc..

- Finn Arne

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/