From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751564AbdK3UGN (ORCPT ); Thu, 30 Nov 2017 15:06:13 -0500 Received: from mx2.suse.de ([195.135.220.15]:47839 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750898AbdK3UGM (ORCPT ); Thu, 30 Nov 2017 15:06:12 -0500 Date: Thu, 30 Nov 2017 21:06:10 +0100 From: Michal Hocko To: Mike Kravetz Cc: linux-mm@kvack.org, Naoya Horiguchi , LKML Subject: Re: [PATCH RFC 2/2] mm, hugetlb: do not rely on overcommit limit during migration Message-ID: <20171130200610.uoeentyd2hgxnx62@dhcp22.suse.cz> References: <20171128101907.jtjthykeuefxu7gl@dhcp22.suse.cz> <20171128141211.11117-1-mhocko@kernel.org> <20171128141211.11117-3-mhocko@kernel.org> <20171129092234.eluli2gl7gotj35x@dhcp22.suse.cz> <425a8947-d32a-d6bb-3a0a-2e30275c64c9@oracle.com> <20171130075742.3exagxg6y4j427ut@dhcp22.suse.cz> <20171130195743.52vc6enr3rnivtdx@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171130195743.52vc6enr3rnivtdx@dhcp22.suse.cz> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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