I found a problem with the last version. The attached is for 2.5.65-1.1171 (i.e. after the other post 2.5.65 changes). The bug is fixed, and the code even simpler here. The problem in the prior patch was that cascade should return: (index +1) &... not index &... Here I changed the call to cascade() to expect "index" back so it checks for 0 instead of 1. Nice and simple. -g Tim Schmielau wrote: > On Wed, 19 Mar 2003, george anzinger wrote: > > >>In this case, the simple fix is to bump the >>base->timer_jiffies at the beginning of the loop rather than the end. >> This would cause the new timer to be put in the next jiffie instead >>of the current one AND it is free! > > > Yes, doing it this way looks correct to me. > > >>>No, with the current implementation we need >>> #define INDEX(N) (base->timer_jiffies >> (TVR_BITS + N * TVN_BITS) +1) & >>> TVN_MASK >>>although I'd like to see that cleaned up. >> >>I tried with the +1 and boot hangs trying to set up networking. I >>think the difference is that the init code is trying to set things up >>the way they would look AFTER cascade executes and this is doing it >>BEFORE the cascade call. > > > With the above change, it should be correct without the +1 > > >>>Why 'jiffies -1'? This will just be made up for in the first >>>timer interrupt, where timer_jiffies will get incremented twice. >> >>Again, I removed the -1 in the attached. > > > If you really want to be conservative, we'd better start with > INITIAL_JIFFIES. Should be the same anyways. But if not, we might lose a > timer scheduled for INITIAL_JIFFIES (not that I think it's possible to > insert one before timer initialisation in the first place :-) > or even a timer cascade. > > >>>Did you bother to test the patch? It doesn't even boot for me, and I don't >>>see how it is supposed to. >>>I'll look into it more closely in the evening. Have to go to work now. >> >>The old one ran on 2.5.64 but not 2.5.65 ??? I found and fixed a bug >>(index needs to be caculated INSIDE the while loop) that seems to have >>been the cause. > > > Ok will test in the evening. > > Tim > > -- George Anzinger george@mvista.com High-res-timers: http://sourceforge.net/projects/high-res-timers/ Preemption patch: http://www.kernel.org/pub/linux/kernel/people/rml