Skip to contentSkip to conversation

mm/cma.c: take __GFP_NOWARN into account in cma_alloc()

PATCH New [email protected] 1 participant 1 message Oct 13, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 10/18 mm/cma.c: take __GFP_NOWARN into account in cma_alloc()

From: Boris Brezillon <[email protected]>
Subject: 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).

---

 mm/cma.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/cma.c renamed from mm/cma.c~cma-take-__gfp_nowarn-into-account-in-cma_alloc +1 -1
diff -puN mm/cma.c~cma-take-__gfp_nowarn-into-account-in-cma_alloc mm/cma.c
@@ -460,7 +460,7 @@ struct page *cma_alloc(struct cma *cma,
 
 	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);

_