Skip to content

Commit

Permalink
mm/cma.c: take __GFP_NOWARN into account in cma_alloc()
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Boris Brezillon authored and torvalds committed Oct 13, 2017
1 parent 51962a9 commit ef46501
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/cma.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align,

trace_cma_alloc(pfn, page, count, align);

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

0 comments on commit ef46501

Please sign in to comment.