[PATCH v2] mm: consolidate GFP_NOFAIL checks in the allocator slowpath

From: Michal Hocko
Date: Thu Dec 15 2016 - 05:29:57 EST


On Thu 15-12-16 15:54:37, Hillf Danton wrote:
> On Wednesday, December 14, 2016 11:07 PM Michal Hocko wrote:
[...]
> > /* Avoid allocations with no watermarks from looping endlessly */
> > - if (test_thread_flag(TIF_MEMDIE) && !(gfp_mask & __GFP_NOFAIL))
> > + if (test_thread_flag(TIF_MEMDIE))
> > goto nopage;
> >
> Nit: currently we allow TIF_MEMDIE & __GFP_NOFAIL request to
> try direct reclaim. Are you intentionally reclaiming that chance?

That is definitely not a nit! Thanks for catching that. We definitely
shouldn't bypass the direct reclaim because that would mean we rely on
somebody else makes progress for us.

Updated patch below:
---