Skip to content
  • Michal Hocko's avatar
    mm: consolidate warn_alloc_failed users · 7877cdcc
    Michal Hocko authored
    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/20160929084407.7004-2-mhocko@kernel.org
    
    
    Signed-off-by: default avatarMichal Hocko <mhocko@suse.com>
    Acked-by: default avatarVlastimil Babka <vbabka@suse.cz>
    Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
    Cc: Johannes Weiner <hannes@cmpxchg.org>
    Cc: Mel Gorman <mgorman@suse.de>
    Cc: Dave Hansen <dave.hansen@intel.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    7877cdcc