Skip to content

Commit 1fc28b7

Browse files
gormanmtorvalds
authored andcommitted
page-allocator: allow too high-order warning messages to be suppressed with __GFP_NOWARN
The page allocator warns once when an order >= MAX_ORDER is specified. This is to catch callers of the allocator that are always falling back to their worst-case when it was not expected. However, there are cases where the caller is behaving correctly but cannot suppress the warning. This patch allows the warning to be suppressed by the callers by specifying __GFP_NOWARN. Signed-off-by: Mel Gorman <mel@csn.ul.ie> Acked-by: David Rientjes <rientjes@google.com> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: "Rafael J. Wysocki" <rjw@sisk.pl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 8870326 commit 1fc28b7

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎mm/page_alloc.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1745,8 +1745,10 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
17451745
* be using allocators in order of preference for an area that is
17461746
* too large.
17471747
*/
1748-
if (WARN_ON_ONCE(order >= MAX_ORDER))
1748+
if (order >= MAX_ORDER) {
1749+
WARN_ON_ONCE(!(gfp_mask & __GFP_NOWARN));
17491750
return NULL;
1751+
}
17501752

17511753
/*
17521754
* GFP_THISNODE (meaning __GFP_THISNODE, __GFP_NORETRY and

0 commit comments

Comments
 (0)