Re: [PATCH] generic device DMA (dma_pool update)

James Bottomley (James.Bottomley@SteelEye.com)
Tue, 31 Dec 2002 11:23:28 -0600


david-b@pacbell.net said:
> The same is true of the slab code, which is a better allocator. Why
> should kernels require an extra allocator, when pci_pool can safely be
> eliminated on quite a few systems?

I agree in principle. But the way to get this to work is to allow the slab
allocater to specify its getpages and freepages in the same way as ctor and
dtor, so it can be fed by dma_alloc_coherent. Then you can wrapper the slab
allocator to be used across all platforms (rather than only those which are
coherent and have no IOMMU).

The benefit mempool has over slab is its guaranteed minimum pool size and
hence guaranteed non-failing allocations as long as you manage pool resizing
correctly. I suppose this is primarily useful for storage devices, which
sometimes need memory that cannot be obtained from doing I/O.

However, you can base mempool off slab modified to use dma_alloc_coherent()
and get the benefits of everything.

James

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