Re: [patch 01/28] cpu alloc: The allocator

Christoph Lameter
2007-11-08T18:33:34Z

On Thu, 8 Nov 2007, Peter Zijlstra wrote:

> On Tue, 2007-11-06 at 11:51 -0800, Christoph Lameter wrote:
>
> > +/*
> > + * Lock to protect the bitmap and the meta data for the cpu allocator.
> > + */
> > +static DEFINE_SPINLOCK(cpu_alloc_map_lock);
>
> I thought you got nightmares from global locks :-)

Yes but this one is rarely taken.

> Why a bitmap allocator and not a heap allocator?

Because the allocator must be able to deal with small 4 byte entities.

> Also, looking at the lock usage, this thing is not IRQ safe, so it
> should not be called from hardirq context. Please document this.

Ok.