Re: 2.5.40-mm2

From: Andrew Morton (akpm@digeo.com)
Date: Sun Oct 06 2002 - 17:07:30 EST


Andrew Morton wrote:
>
> ...
> int del_timer_sync(timer_t *timer)
> {
> - tvec_base_t *base = tvec_bases;
> int i, ret;
>
> ret = del_timer(timer);
>
> for (i = 0; i < NR_CPUS; i++) {
> + tvec_base_t *base;
> +
> if (!cpu_online(i))
> continue;
> + base = tvec_bases + i;
> if (base->running_timer == timer) {
> - while (base->running_timer == timer) {
> + while (base->running_timer == timer)
> cpu_relax();
> - preempt_disable();
> - preempt_enable();
> - }
> break;
> }
> base++;

Oh, OK. There's a base++ hidden at the end there :(

So the code as-is will work OK if all your online CPUs are
adjacent, starting at CPU0. It is incorrect if you have
gaps in your online map.
-
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/



This archive was generated by hypermail 2b29 : Mon Oct 07 2002 - 22:00:56 EST