Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1542188

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

From Johannes Weiner <hannes@cmpxchg.org>
Newsgroups linux.kernel
Subject Re: [PATCH] mm: consolidate GFP_NOFAIL checks in the allocator slowpath
Date 2016-12-14 21:50 +0100
Message-ID <sOoEV-41k-7@gated-at.bofh.it> (permalink)
References <sOjlT-7Zi-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Dec 14, 2016 at 04:07:06PM +0100, Michal Hocko wrote:
> From: Michal Hocko <mhocko@suse.com>
> 
> Tetsuo Handa has pointed out that 0a0337e0d1d1 ("mm, oom: rework oom
> detection") has subtly changed semantic for costly high order requests
> with __GFP_NOFAIL and withtout __GFP_REPEAT and those can fail right now.
> My code inspection didn't reveal any such users in the tree but it is
> true that this might lead to unexpected allocation failures and
> subsequent OOPs.
> 
> __alloc_pages_slowpath wrt. GFP_NOFAIL is hard to follow currently.
> There are few special cases but we are lacking a catch all place to be
> sure we will not miss any case where the non failing allocation might
> fail. This patch reorganizes the code a bit and puts all those special
> cases under nopage label which is the generic go-to-fail path. Non
> failing allocations are retried or those that cannot retry like
> non-sleeping allocation go to the failure point directly. This should
> make the code flow much easier to follow and make it less error prone
> for future changes.
> 
> While we are there we have to move the stall check up to catch
> potentially looping non-failing allocations.
> 
> Signed-off-by: Michal Hocko <mhocko@suse.com>
> Acked-by: Vlastimil Babka <vbabka@suse.cz>

It's not the nicest thing that we have to duplicate all the conditions
to warn on, but it's preferable over unreliable GFP_NOFAIL handling.
Consolidating the handling of this flag makes a lot of sense to me.

Acked-by: Johannes Weiner <hannes@cmpxchg.org>

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] mm: consolidate GFP_NOFAIL checks in the allocator slowpath Michal Hocko <mhocko@kernel.org> - 2016-12-14 16:10 +0100
  Re: [PATCH] mm: consolidate GFP_NOFAIL checks in the allocator  slowpath Johannes Weiner <hannes@cmpxchg.org> - 2016-12-14 21:50 +0100
  Re: [PATCH] mm: consolidate GFP_NOFAIL checks in the allocator slowpath "Hillf Danton" <hillf.zj@alibaba-inc.com> - 2016-12-15 09:10 +0100
    [PATCH v2] mm: consolidate GFP_NOFAIL checks in the allocator  slowpath Michal Hocko <mhocko@kernel.org> - 2016-12-15 11:30 +0100
      Re: [PATCH v2] mm: consolidate GFP_NOFAIL checks in the allocator slowpath Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2016-12-16 12:40 +0100
        Re: [PATCH v2] mm: consolidate GFP_NOFAIL checks in the allocator  slowpath Michal Hocko <mhocko@kernel.org> - 2016-12-16 13:00 +0100

csiph-web