mm: consolidate warn_alloc_failed users
authorMichal Hocko <[email protected]>
Sat, 8 Oct 2016 00:01:55 +0000 (17:01 -0700)
committerLinus Torvalds <[email protected]>
Sat, 8 Oct 2016 01:46:29 +0000 (18:46 -0700)
commit7877cdcc3893c1bd9a833b2f0398e7320794c6e6
treeab2c1885303f60c534a981d42eac6e035c7acd04
parentc2a9737f45e27d8263ff9643f994bda9bac0b944
mm: consolidate warn_alloc_failed users

warn_alloc_failed is currently used from the page and vmalloc
allocators.  This is a good reuse of the code except that vmalloc would
appreciate a slightly different warning message.  This is already
handled by the fmt parameter except that

  "%s: page allocation failure: order:%u, mode:%#x(%pGg)"

is printed anyway.  This might be quite misleading because it might be a
vmalloc failure which leads to the warning while the page allocator is
not the culprit here.  Fix this by always using the fmt string and only
print the context that makes sense for the particular context (e.g.
order makes only very little sense for the vmalloc context).

Rename the function to not miss any user and also because a later patch
will reuse it also for !failure cases.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Michal Hocko <[email protected]>
Acked-by: Vlastimil Babka <[email protected]>
Cc: Tetsuo Handa <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: Mel Gorman <[email protected]>
Cc: Dave Hansen <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
include/linux/mm.h
mm/page_alloc.c
mm/vmalloc.c