Re: [patch 1/2 for-4.20] mm, thp: restore node-local hugepage allocations

From: David Rientjes
Date: Wed Dec 05 2018 - 14:24:59 EST


On Wed, 5 Dec 2018, Michal Hocko wrote:

> > > At minimum do not remove the cleanup part which consolidates the gfp
> > > hadnling to a single place. There is no real reason to have the
> > > __GFP_THISNODE ugliness outside of alloc_hugepage_direct_gfpmask.
> > >
> >
> > The __GFP_THISNODE usage is still confined to
> > alloc_hugepage_direct_gfpmask() for the thp fault path, we no longer set
> > it in alloc_pages_vma() as done before the cleanup.
>
> Why should be new_page any different?
>

To match alloc_new_node_page() which does it correctly and does not change
the behavior of mbind() that the cleanup did, which used
alloc_hugepage_vma() to get the __GFP_THISNODE behavior. If there is a
reason mbind() is somehow different wrt allocating hugepages locally, I
think that should be a separate patch, but the goal of this patch is to
revert all the behavioral change that caused hugepages to be allocated
remotely.