dma/pool: eliminate alloc_pages warning in atomic_pool_expand
PATCH 1/1 dma/pool: eliminate alloc_pages warning in atomic_pool_expand
atomic_pool_expand iterately tries the allocation while decrementing the page order. There is no need to issue a warning if an attempted allocation fails.
--- kernel/dma/pool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/dma/pool.c +1 -1
@@ -93,7 +93,7 @@ static int atomic_pool_expand(struct gen_pool *pool, size_t pool_size, page =dma_alloc_from_contiguous (NULL ,1 << order, order, false);if (!page) - page =alloc_pages (gfp, order); + page =alloc_pages (gfp | __GFP_NOWARN, order); }while (!page && order-- >0 );if (!page) goto out;
Signature · 1 line
2.52.0
Quoted 1 line · Dave Kleikamp
atomic_pool_expanditerately tries the allocation while decrementing the
"iteratively"?
Quoted 13 lines
page order. There is no need to issue a warning if an attempted allocation fails.
Signed-off-by Dave Kleikamp <[email protected]>--- kernel/dma/pool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel/dma/pool.c +0
-0
kernel/dma/pool.c static int atomic_pool_expand(struct gen_pool *pool, size_t pool_size, · line 96
Quoted 5 lines
kernel/dma/pool.c +1
-1@@ -93,7 +93,7 @@ static int atomic_pool_expand(struct gen_pool *pool, size_t pool_size, page =dma_alloc_from_contiguous (NULL ,1 << order, order, false);if (!page) - page =alloc_pages (gfp, order); + page =alloc_pages (gfp | __GFP_NOWARN, order);
Might be nice to keep some kind of warning if we entirely fail all the way down to order 0, although I guess if it matters it would show up via the warning on dma_alloc_from_pool() failure soon enough anyway...
Either way it certainly makes sense in general;
Quoted 3 lines
kernel/dma/pool.c +0
-0}while (!page && order-- >0 );if (!page) goto out;
Quoted 4 lines · Robin Murphy
Quoted 1 line · Dave Kleikamp
atomic_pool_expanditerately tries the allocation while decrementing the"iteratively"?
Oops.
Quoted 23 lines
Quoted 14 lines
page order. There is no need to issue a warning if an attempted allocation fails.
Signed-off-by Dave Kleikamp <[email protected]>---
kernel/dma/pool.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)kernel/dma/pool.c +0
-0kernel/dma/pool.c static int atomic_pool_expand(struct gen_pool *pool, · line 97
Quoted 6 lines
kernel/dma/pool.c +1
-1@@ -93,7 +93,7 @@ static int atomic_pool_expand(struct gen_pool *pool,size_t pool_size, page = dma_alloc_from_contiguous(NULL, 1 << order, order, false); if (!page) - page = alloc_pages(gfp, order); + page = alloc_pages(gfp | __GFP_NOWARN, order);Might be nice to keep some kind of warning if we entirely fail all the way down to order 0, although I guess if it matters it would show up via the warning on
dma_alloc_from_pool()failure soon enough anyway...
Quoted 3 lines
Either way it certainly makes sense in general;
Reviewed-by Robin Murphy <[email protected]>
Thanks
Quoted 5 lines
Quoted 4 lines
kernel/dma/pool.c +0
-0} while (!page && order-- > 0); if (!page)goto out;
Quoted 5 lines · Dave Kleikamp
atomic_pool_expanditerately tries the allocation while decrementing the page order. There is no need to issue a warning if an attempted allocation fails.Signed-off-by Dave Kleikamp <[email protected]>
memory zone")
Applied to dma-mapping-fixes branch with typo in commit message fixed.
Quoted 9 lines
--- kernel/dma/pool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel/dma/pool.c +0
-0
kernel/dma/pool.c static int atomic_pool_expand(struct gen_pool *pool, size_t pool_size, · line 99
Quoted 8 lines
kernel/dma/pool.c +1
-1@@ -93,7 +93,7 @@ static int atomic_pool_expand(struct gen_pool *pool, size_t pool_size, page =dma_alloc_from_contiguous (NULL ,1 << order, order, false);if (!page) - page =alloc_pages (gfp, order); + page =alloc_pages (gfp | __GFP_NOWARN, order); }while (!page && order-- >0 );if (!page) goto out;
Best regards
Signature · 2 lines
Marek Szyprowski, PhD Samsung R&D Institute Poland