Re: [RFC] [PATCH] Performance of del_timer_sync
From: Ingo Molnar
Date: Tue May 11 2004 - 14:59:08 EST
* Andrew Morton <akpm@xxxxxxxx> wrote:
> Ingo, why is this not sufficient?
>
> @@ -331,6 +331,8 @@ int del_timer_sync(struct timer_list *ti
>
> del_again:
> ret += del_timer(timer);
> + if (!ret)
> + return 0;
>
> for_each_cpu(i) {
> base = &per_cpu(tvec_bases, i);
it's not sufficient because a timer might be running on another CPU even
if it has not been deleted. We delete a timer prior running it (so that
the timer fn can re-activate the timer). So del_timer_sync() has to
synchronize independently of whether the timer was removed or not.
Ingo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/