Re: [PATCH RFC 2/2] mm, hugetlb: do not rely on overcommit limit during migration

From: Michal Hocko
Date: Thu Nov 30 2017 - 15:06:16 EST


On Thu 30-11-17 20:57:43, Michal Hocko wrote:
> On Thu 30-11-17 11:35:11, Mike Kravetz wrote:
> > On 11/29/2017 11:57 PM, Michal Hocko wrote:
> > > On Wed 29-11-17 11:52:53, Mike Kravetz wrote:
> > >> On 11/29/2017 01:22 AM, Michal Hocko wrote:
> > >>> What about this on top. I haven't tested this yet though.
> > >>
> > >> Yes, this would work.
> > >>
> > >> However, I think a simple modification to your previous free_huge_page
> > >> changes would make this unnecessary. I was confused in your previous
> > >> patch because you decremented the per-node surplus page count, but not
> > >> the global count. I think it would have been correct (and made this
> > >> patch unnecessary) if you decremented the global counter there as well.
> > >
> > > We cannot really increment the global counter because the over number of
> > > surplus pages during migration doesn't increase.
> >
> > I was not suggesting we increment the global surplus count. Rather,
> > your previous patch should have decremented the global surplus count in
> > free_huge_page. Something like:
>
> sorry I meant to say decrement. The point is that overal suprlus count
> doesn't change after the migration. The only thing that _might_ change
> is the per node distribution of surplus pages. That is why I think we
> should handle that during the migration.

Let me clarify. The migration context is the only place where we have
both the old and new page so this sounds like the only place to know
that we need to transfer the per-node surplus state.
--
Michal Hocko
SUSE Labs