Messages in this thread |  | | Date | Tue, 17 Apr 2018 21:16:42 -0700 (PDT) | From | David Rientjes <> | Subject | Re: [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.
|  |