lkml.org 
[lkml]   [2018]   [Apr]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mm:memcg: add __GFP_NOWARN in __memcg_schedule_kmem_cache_create
On Tue, 17 Apr 2018, Matthew Wilcox wrote:

> Not arguing against this patch. But how many places do we want to use
> GFP_NOWAIT without __GFP_NOWARN? Not many, and the few which do do this
> seem like they simply haven't added it yet. Maybe this would be a good idea?
>
> -#define GFP_NOWAIT (__GFP_KSWAPD_RECLAIM)
> +#define GFP_NOWAIT (__GFP_KSWAPD_RECLAIM | __GFP_NOWARN)
>

I don't think that's a good idea, slab allocators use GFP_NOWAIT during
init, for example, followed up with a BUG_ON() if it fails. With an
implicit __GFP_NOWARN we wouldn't be able to see the state of memory when
it crashes (likely memory that wasn't freed to the allocator). I think
whether the allocation failure should trigger a warning is up to the
caller.

\
 
 \ /
  Last update: 2018-04-18 06:17    [W:0.076 / U:0.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site