Re: [PATCH] mm, oom: Give __GFP_NOFAIL allocations access to memory reserves

From: Michal Hocko
Date: Tue Nov 24 2015 - 04:47:23 EST


On Mon 23-11-15 13:26:49, David Rientjes wrote:
> On Mon, 23 Nov 2015, Michal Hocko wrote:
[...]
> > I am not sure I follow you here. The point of the warning is to warn
> > when the oom killer is disbaled (out_of_memory returns false) _and_ the
> > request is __GFP_NOFAIL because we simply cannot guarantee any forward
> > progress and just a use of the allocation flag is not supproted.
> >
>
> I don't think the WARN_ONCE() above is helpful for a few reasons:
>
> - it suggests that min_free_kbytes is the best way to work around such
> issues and gives kernel developers a free pass to just say "raise
> min_free_kbytes" rather than reducing their reliance on __GFP_NOFAIL,

I disagree. Users are quite sensitive to warnings with backtraces in the
log from my experience and they report them. And while the log shows the
code path which triggers the issue which can help us to change the code
it also gives a useful hint on how to reduce this issue until we are
able to either fix a bug or a permanent configuration if we are not able
to get rid of it for whatever reason.

Besides that there is no other reliable warning that we are getting
_really_ short on memory unlike when the allocation failure is
allowed. OOM killer report might be missing because there was no actual
killing happening.

> - raising min_free_kbytes is not immediately actionable without memory
> freeing to fix any oom issue, and

true but it can be done to reduce chances for the issue to reappear.

> - it relies on the earlier warning to dump the state of memory and
> doesn't add any significant information to help understand how seperate
> occurrences are similar or different.

The information is quite valuable even without OOM killer report IMHO.

> I think the WARN_ONCE() should just be removed.

I do not insist on keeping it but I really think it might be useful
while it doesn't seem to cause any confusion IMHO. So unless there is a
strong reason to not include it I would prefer keeping it.
--
Michal Hocko
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/