Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1763292AbdDSMuT (ORCPT ); Wed, 19 Apr 2017 08:50:19 -0400 Received: from mx2.suse.de ([195.135.220.15]:59081 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1762713AbdDSMuP (ORCPT ); Wed, 19 Apr 2017 08:50:15 -0400 Date: Wed, 19 Apr 2017 14:50:10 +0200 From: Michal Hocko To: Vlastimil Babka Cc: Joonsoo Kim , linux-mm@kvack.org, Andrew Morton , Mel Gorman , Andrea Arcangeli , Jerome Glisse , Reza Arbab , Yasuaki Ishimatsu , qiuxishi@huawei.com, Kani Toshimitsu , slaoub@gmail.com, Andi Kleen , David Rientjes , Daniel Kiper , Igor Mammedov , Vitaly Kuznetsov , LKML Subject: Re: [PATCH 1/3] mm: consider zone which is not fully populated to have holes Message-ID: <20170419125010.GH29789@dhcp22.suse.cz> References: <20170410110351.12215-1-mhocko@kernel.org> <20170415121734.6692-1-mhocko@kernel.org> <20170415121734.6692-2-mhocko@kernel.org> <97a658cd-e656-6efa-7725-150063d276f1@suse.cz> <20170418092757.GM22360@dhcp22.suse.cz> <12814e7e-5ed7-de1f-3e7c-9501eec1682a@suse.cz> <20170419121637.GG29789@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1726 Lines: 39 On Wed 19-04-17 14:34:54, Vlastimil Babka wrote: > On 04/19/2017 02:16 PM, Michal Hocko wrote: > > On Wed 19-04-17 13:59:40, Vlastimil Babka wrote: > >> On 04/18/2017 11:27 AM, Michal Hocko wrote: > > [...] > >>> I am not aware of any such user. PageReserved has always been about "the > >>> core mm should touch these pages and modify their state" AFAIR. > >>> But I believe that touching those holes just asks for problems so I > >>> would rather have them covered. > >> > >> OK. I guess it's OK to use PageReserved of first pageblock page to > >> determine if we can trust page_zone(), because the memory offline > >> scenario should have sufficient granularity and not make holes inside > >> pageblock? > > > > Yes memblocks should be section size aligned and that is 128M resp. 2GB > > on large machines. So we are talking about much larger than page block > > granularity here. > > > > Anyway, Joonsoo didn't like the the explicit PageReserved checks so I > > have come with pfn_to_online_page which hides this implementation > > detail. How do you like the following instead? > > Yeah that's OK. The other two patches will be updated as well? yes > Ideally we would later convert this helper to use some special values > for zone/node id (such as -1) instead of PageReserved to indicate an > offline node, as we discussed. I have considered zone_id to be -1 but there is just too much code which uses the id to translate it to the struct zone * directly and that would lead to subtle bugs. On the other hand zone_id == 0 is not optimal but much safer from that POV. I will think about the safest way forward long term but my intention was to have something reasonably good for starter. -- Michal Hocko SUSE Labs