As near as I can tell this is not true if done here. I could be
wrong, but I think the tests will fail if the "1" is added. I will
try it though, just to be sure.
>
>
>>+
>>static inline void __run_timers(tvec_base_t *base)
>> {
>>+ int index = base->timer_jiffies & TVR_MASK;
>> spin_lock_irq(&base->lock);
>>+ if(jiffies - base->timer_jiffies > 0)
>> while ((long)(jiffies - base->timer_jiffies) >= 0) {
>> struct list_head *head, *curr;
>>
>
>
> Are the doubled 'if' and 'while' really what you meant?
Darn, you are right. The if is left over debug code. Teach me to do
ifs with out {}.
>
>
>>@@ -1181,12 +1182,7 @@
>> for (j = 0; j < TVR_SIZE; j++)
>> INIT_LIST_HEAD(base->tv1.vec + j);
>>
>>- base->timer_jiffies = INITIAL_JIFFIES;
>>- base->tv1.index = INITIAL_JIFFIES & TVR_MASK;
>>- base->tv2.index = (INITIAL_JIFFIES >> TVR_BITS) & TVN_MASK;
>>- base->tv3.index = (INITIAL_JIFFIES >> (TVR_BITS+TVN_BITS)) &
>
> TVN_MASK;
>
>>- base->tv4.index = (INITIAL_JIFFIES >> (TVR_BITS+2*TVN_BITS)) &
>
> TVN_MASK;
>
>>- base->tv5.index = (INITIAL_JIFFIES >> (TVR_BITS+3*TVN_BITS)) &
>
> TVN_MASK;
>
>>+ base->timer_jiffies = jiffies -1;
>> }
>>
>> static int __devinit timer_cpu_notify(struct notifier_block *self,
>
>
> Why 'jiffies -1'? This will just be made up for in the first
> timer interrupt, where timer_jiffies will get incremented twice.
I wanted to be conservative. Jiffies should work, but as you say it
will be made up. I did not want ANY possibity of getting a timer in
the list ahead of where the list was.
>
>
> 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 did, and it booted and ran the clock_nanosleep test (actually a more
rigerous verson of same).
> I'll look into it more closely in the evening. Have to go to work now.
>
> 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- 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/