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

James Bottomley (James.Bottomley@SteelEye.com)
Tue, 31 Dec 2002 17:47:49 -0600


david-b@pacbell.net said:
> USB device drivers tend to either allocate and reuse one dma buffer
> (kmalloc/kfree usage pattern) or use dma mapping ... so far.

Please be careful with this in drivers. Coherent memory can be phenomenally
expensive to obtain on some hardware. Sometimes it has to be implemented by
turning off caching and globally flushing the tlb. Thus it really makes
sense most of the time for drivers to allocate all the coherent memory they
need initially and not have it go through the usual memory allocate/free cycle
except under extreme conditions. That's sort really what both pci_pool and
mempool aim for.

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/