Skip to content

Commit ef46501

Browse files
Boris Brezillontorvalds
authored andcommitted
mm/cma.c: take __GFP_NOWARN into account in cma_alloc()
cma_alloc() unconditionally prints an INFO message when the CMA allocation fails. Make this message conditional on the non-presence of __GFP_NOWARN in gfp_mask. This patch aims at removing INFO messages that are displayed when the VC4 driver tries to allocate buffer objects. From the driver perspective an allocation failure is acceptable, and the driver can possibly do something to make following allocation succeed (like flushing the VC4 internal cache). Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Boris Brezillon <[email protected]> Acked-by: Laura Abbott <[email protected]> Cc: Jaewon Kim <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Eric Anholt <[email protected]> Cc: Joonsoo Kim <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 51962a9 commit ef46501

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/cma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align,
460460

461461
trace_cma_alloc(pfn, page, count, align);
462462

463-
if (ret) {
463+
if (ret && !(gfp_mask & __GFP_NOWARN)) {
464464
pr_info("%s: alloc failed, req-size: %zu pages, ret: %d\n",
465465
__func__, count, ret);
466466
cma_debug_show_areas(cma);

0 commit comments

Comments
 (0)