Re: Fw: [Bug 4559] New: cfq scheduler lockup: NMI oops while runningltp - 20050207 on 2.6.12-rc2-mm3 with kdump enabled

From: Oleg Nesterov
Date: Sat Apr 30 2005 - 07:38:23 EST

Andrew Morton wrote:
> Timer bug, I guess.

Yes, the new timer code is racy. Example:

spinlock_t LOCK;

void void timer_func()

timer_list TIMER = TIMER_INITIALIZER(timer_func);


sets ->running_timer = &TIMER;
calls timer_func()
waits for &LOCK

/* Ensure the timer is serialized. */
retries while ->running_timer == &TIMER

Many thanks to Maneesh Soni for his excellent analysis in

Note that del_timer_sync has this problem too, but this
situation is forbidden by synchronization rules.

At the moment I don't have a proper solution.

One option is to change __mod_timer() so that it would not
switch ->base when the timer is already running. But this
would be behavioural change: currently __mod_timer() guarantees
that the timer would be armed on the local cpu.

I'll try to find a solution, but perhaps it's better to drop
this patch for now.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at