[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170119084510.GF30786@dhcp22.suse.cz>
Date: Thu, 19 Jan 2017 09:45:11 +0100
From: Michal Hocko <mhocko@...nel.org>
To: John Hubbard <jhubbard@...dia.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Vlastimil Babka <vbabka@...e.cz>,
David Rientjes <rientjes@...gle.com>,
Mel Gorman <mgorman@...e.de>,
Johannes Weiner <hannes@...xchg.org>,
Al Viro <viro@...iv.linux.org.uk>, linux-mm@...ck.org,
LKML <linux-kernel@...r.kernel.org>,
Anatoly Stepanov <astepanov@...udlinux.com>,
Paolo Bonzini <pbonzini@...hat.com>,
Mike Snitzer <snitzer@...hat.com>,
"Michael S. Tsirkin" <mst@...hat.com>,
Theodore Ts'o <tytso@....edu>
Subject: Re: [PATCH 1/6] mm: introduce kv[mz]alloc helpers
On Thu 19-01-17 00:37:08, John Hubbard wrote:
>
>
> On 01/18/2017 12:21 AM, Michal Hocko wrote:
> > On Tue 17-01-17 21:59:13, John Hubbard wrote:
[...]
> > > * Reclaim modifiers - __GFP_NORETRY and __GFP_NOFAIL should not be passed in.
> > > * Passing in __GFP_REPEAT is supported, but note that it is ignored for small
> > > * (<=64KB) allocations, during the kmalloc attempt.
> >
> > > __GFP_REPEAT is fully
> > > * honored for all allocation sizes during the second part: the vmalloc attempt.
> >
> > this is not true to be really precise because vmalloc doesn't respect
> > the given gfp mask all the way down (look at the pte initialization).
> >
>
> I'm having some difficulty in locating that pte initialization part, am I on
> the wrong code path? Here's what I checked, before making the claim about
> __GFP_REPEAT being honored:
>
> kvmalloc_node
> __vmalloc_node_flags
> __vmalloc_node
> __vmalloc_node_range
> __vmalloc_area_node
map_vm_area
vmap_page_range
vmap_page_range_noflush
vmap_pud_range
pud_alloc
__pud_alloc
pud_alloc_one
pud will be allocated but the same pattern repeats on the pmd and pte
levels. This is btw. one of the reasons why vmalloc with gfp flags is
tricky!
moreover
> alloc_pages_node
this is order-0 request so...
> __alloc_pages_node
> __alloc_pages
> __alloc_pages_nodemask
> __alloc_pages_slowpath
>
>
> ...and __alloc_pages_slowpath does the __GFP_REPEAT handling:
>
> /*
> * Do not retry costly high order allocations unless they are
> * __GFP_REPEAT
> */
> if (order > PAGE_ALLOC_COSTLY_ORDER && !(gfp_mask & __GFP_REPEAT))
> goto nopage;
... this doesn't apply
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists