[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 2.5.40-mm2



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, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/