public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [patch] del_timer_sync scalability patch
@ 2005-03-11 18:54 Oleg Nesterov
  2005-03-11 20:57 ` Christoph Lameter
  2005-03-13 13:13 ` [patch] del_timer_sync scalability patch Oleg Nesterov
  0 siblings, 2 replies; 18+ messages in thread
From: Oleg Nesterov @ 2005-03-11 18:54 UTC (permalink / raw)
  To: linux-kernel; +Cc: Shai Fultheim, Christoph Lameter, Andrew Morton, Ingo Molnar

Hello.

I am not sure, but I think this patch incorrect.

> @@ -466,6 +482,7 @@ repeat:
>  			set_running_timer(base, timer);
>  			smp_wmb();
>  			timer->base = NULL;
------>	WINDOW <------
> +			set_last_running(timer, base);
>  			spin_unlock_irq(&base->lock);

Suppose it is the first invocation of timer, so
timer->last_running == NULL.

What if del_timer_sync() happens in that window?

del_timer_sync:
	del_timer();	// timer->base == NULL, returns

	base = timer->last_running;
	if (base)	// no, it is still NULL
		...

	if (timer->base != NULL || timer->last_running != base)
		goto del_again;	// not taken

	return;

I think it is not enough to exchange these 2 lines in
__run_timers, we also need barriers.

Oleg.

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2005-03-16 15:49 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-11 18:54 [patch] del_timer_sync scalability patch Oleg Nesterov
2005-03-11 20:57 ` Christoph Lameter
2005-03-15 17:19   ` [PATCH 0/2] del_timer_sync: proof of concept Oleg Nesterov
2005-03-15 18:15     ` Christoph Lameter
2005-03-15 19:41       ` Oleg Nesterov
2005-03-15 19:02         ` Christoph Lameter
2005-03-16 16:55     ` Oleg Nesterov
2005-03-15 17:19   ` [PATCH 1/2] " Oleg Nesterov
2005-03-15 17:20   ` [PATCH 2/2] " Oleg Nesterov
2005-03-16  9:00     ` Ingo Molnar
2005-03-16 12:09       ` Oleg Nesterov
2005-03-16 13:52         ` Ingo Molnar
2005-03-13 13:13 ` [patch] del_timer_sync scalability patch Oleg Nesterov
2005-03-14 19:40   ` Christoph Lameter
2005-03-15  9:12     ` Oleg Nesterov
2005-03-15  8:06   ` Christoph Lameter
2005-03-15  9:28     ` Ingo Molnar
2005-03-15 10:28     ` Oleg Nesterov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox