Re: [RFC 0/2] new kfifo API

From: Arnd Bergmann
Date: Mon Aug 03 2009 - 14:35:48 EST


On Monday 03 August 2009, Andi Kleen wrote:
> > struct kfifo *kfifo_alloc(unsigned long size, gfp_t gfp_mask)
> > Dynamically allocates a new fifo and returns the address
> > @size: the size of the internal buffer to be allocated.
> > @gfp_mask: get_free_pages mask, passed to kmalloc()
>
> For the MCE use case this would need to be able to optionally use
> bootmem because the first initialization happens too early.

The existing API has a kfifo_init for that purpose, so you can
pass a preallocated (bootmem, static, coherent, aligned, ...) buffer
into the FIFO.

That might be nice to keep, by leaving the 'buffer' as pointer
in struct kfifo, which could still point to a buffer that is
allocated together with the structu kfifo.

Arnd <><
--
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/