[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aa4565e7-af59-483a-a875-5bd970c9c923@arm.com>
Date: Mon, 12 Jan 2026 14:13:19 +0000
From: Robin Murphy <robin.murphy@....com>
To: Sai Sree Kartheek Adivi <s-adivi@...com>, m.szyprowski@...sung.com,
iommu@...ts.linux.dev, linux-kernel@...r.kernel.org
Cc: vigneshr@...com
Subject: Re: [PATCH v2] dma/pool: respect __GFP_NOWARN in
dma_alloc_from_pool()
On 2026-01-12 10:47 am, Sai Sree Kartheek Adivi wrote:
> Currently, dma_alloc_from_pool() unconditionally warns and dumps a stack
> trace when an allocation fails.
>
> This prevents callers from using the __GFP_NOWARN flag to suppress error
> messages, breaking the expectation that this flag will silence
> allocation failure logs.
This is not an "allocation failure" in that sense, though. It's not like
the caller has opportunistically requested a large allocation, and is
happy to try again with a smaller size - if someone has asked for an
allocation in atomic context that can only be satisfied from an atomic
pool, and there is no atomic pool at all, that points at something being
more fundamentally wrong with the system, in a manner that the caller
probably isn't expecting.
Under what circumstances are you seeing the warning without things being
totally broken anyway?
Thanks,
Robin.
> Align dma_pool behaviour with other core allocators by checking for
> __GFP_NOWARN before issuing the warning.
>
> Fixes: 9420139f516d ("dma-pool: fix coherent pool allocations for IOMMU mappings")
> Signed-off-by: Sai Sree Kartheek Adivi <s-adivi@...com>
> ---
> kernel/dma/pool.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/dma/pool.c b/kernel/dma/pool.c
> index 26392badc36b..f63e027b8a27 100644
> --- a/kernel/dma/pool.c
> +++ b/kernel/dma/pool.c
> @@ -276,7 +276,7 @@ struct page *dma_alloc_from_pool(struct device *dev, size_t size,
> return page;
> }
>
> - WARN(1, "Failed to get suitable pool for %s\n", dev_name(dev));
> + WARN(!(gfp & __GFP_NOWARN), "Failed to get suitable pool for %s\n", dev_name(dev));
> return NULL;
> }
>
Powered by blists - more mailing lists