Re: [patch] mm, page_alloc: make __GFP_NOFAIL really not fail

From: David Rientjes
Date: Tue Dec 10 2013 - 19:11:52 EST


On Tue, 10 Dec 2013, Andrew Morton wrote:

> > Heh, it's difficult to remove __GFP_NOFAIL when new users get added:
> > 84235de394d9 ("fs: buffer: move allocation failure loop into the
> > allocator") added a new user
>
> That wasn't reeeeealy a new user - it was "convert an existing
> open-coded retry-for-ever loop". Which is what __GFP_NOFAIL is for.
>

No, it just looks like that's what it did. find_or_create_page() in that
function does an order-0 allocation which always implicitly __GFP_NOFAIL
because of the should_alloc_retry() behavior. So why does it need to add
__GFP_NOFAIL there now? Because it is now allowed to bypass memcg limits
to the root memcg, which is new behavior with the patch. It adds
additional memcg powers that can't be duplicated in the caller, so now
it's really become __GFP_BYPASS_MEMCG_LIMIT_ON_OOM for everything that was
doing order-3 or smaller allocations, which should be all existing
__GFP_NOFAIL users.
--
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/