Re: [PATCH] x86: sparse_irq need spin_lock in alloc

From: Ingo Molnar
Date: Thu Aug 21 2008 - 06:28:24 EST



* Ingo Molnar <mingo@xxxxxxx> wrote:

> * Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> > Each of these locks can be made local to the function in which they
> > are used (and hence they should be made local).
> >
> > It would be nice to add a comment explaining what they are protecting,
> > unless that is obvious (I didn't look).
>
> ok - i moved the locks next to the data structure they protect (the free
> list head), and added a small exlanation as well - as per the commit
> below.

they also need to be irqsafe locks, as they might be taken inside
irq-safe locks. Updated patch below.

Ingo