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

David Brownell
2003-01-02T01:56:58Z

James Bottomley wrote:
> adam@yggdrasil.com said:
>
>> Can someone show me or invent an example of two different uses of
>>dma_alloc_coherent that really should use different policies on
>>whether to block or not?
>
>
> The obvious one is allocations from interrupt routines, which must be
> GFP_ATOMIC (ignoring the issue of whether a driver should be doing a memory
> allocation in an interrupt). Allocating large pools at driver initialisation
> should probably be GFP_KERNEL as you say.

More: not just "from interrupt routines", also "when a spinlock is held".
Though one expects that if a dma_pool were in use, it'd probably have one
of that kind of chunk already available (ideally, even initialized).

Many task-initiated allocations would use GFP_KERNEL; not just major driver
activation points like open().

- Dave