Re: [PATCH v3] dma/pool: distinguish between missing and exhausted atomic pools
From: Marek Szyprowski
Date: Thu Jan 29 2026 - 04:26:35 EST
On 28.01.2026 14:35, Sai Sree Kartheek Adivi wrote:
> Currently, dma_alloc_from_pool() unconditionally warns and dumps a stack
> trace when an allocation fails, with the message "Failed to get suitable
> pool".
>
> This conflates two distinct failure modes:
> 1. Configuration error: No atomic pool is available for the requested
> DMA mask (a fundamental system setup issue)
> 2. Resource Exhaustion: A suitable pool exists but is currently full (a
> recoverable runtime state)
>
> This lack of distinction prevents drivers from using __GFP_NOWARN to
> suppress error messages during temporary pressure spikes, such as when
> awaiting synchronous reclaim of descriptors.
>
> Refactor the error handling to distinguish these cases:
> - If no suitable pool is found, keep the unconditional WARN regarding
> the missing pool.
> - If a pool was found but is exhausted, respect __GFP_NOWARN and update
> the warning message to explicitly state "DMA pool exhausted".
>
> Fixes: 9420139f516d ("dma-pool: fix coherent pool allocations for IOMMU mappings")
> Signed-off-by: Sai Sree Kartheek Adivi <s-adivi@xxxxxx>
Applied to dma-mapping-fixes. Thanks!
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland