From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031442AbdDTMOB (ORCPT ); Thu, 20 Apr 2017 08:14:01 -0400 Received: from mx2.suse.de ([195.135.220.15]:59103 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1031275AbdDTMN6 (ORCPT ); Thu, 20 Apr 2017 08:13:58 -0400 Date: Thu, 20 Apr 2017 14:13:54 +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: your mail Message-ID: <20170420121354.GE15781@dhcp22.suse.cz> References: <20170410110351.12215-1-mhocko@kernel.org> <20170415121734.6692-1-mhocko@kernel.org> <20170417054718.GD1351@js1304-desktop> <20170417081513.GA12511@dhcp22.suse.cz> <20170420012753.GA22054@js1304-desktop> <20170420072820.GB15781@dhcp22.suse.cz> <20170420084930.GC15781@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 On Thu 20-04-17 13:56:34, Vlastimil Babka wrote: > On 04/20/2017 10:49 AM, Michal Hocko wrote: > > On Thu 20-04-17 09:28:20, Michal Hocko wrote: > >> On Thu 20-04-17 10:27:55, Joonsoo Kim wrote: > > [...] > >>> Your patch try to add PageReserved() to __pageblock_pfn_to_page(). It > >>> woule make that zone->contiguous usually returns false since memory > >>> used by memblock API is marked as PageReserved() and your patch regard > >>> it as a hole. It invalidates set_zone_contiguous() optimization and I > >>> worry about it. > >> > >> OK, fair enough. I did't consider memblock allocations. I will rethink > >> this patch but there are essentially 3 options > >> - use a different criterion for the offline holes dection. I > >> have just realized we might do it by storing the online > >> information into the mem sections > >> - drop this patch > >> - move the PageReferenced check down the chain into > >> isolate_freepages_block resp. isolate_migratepages_block > >> > >> I would prefer 3 over 2 over 1. I definitely want to make this more > >> robust so 1 is preferable long term but I do not want this to be a > >> roadblock to the rest of the rework. Does that sound acceptable to you? > > > > So I've played with all three options just to see how the outcome would > > look like and it turned out that going with 1 will be easiest in the > > end. What do you think about the following? It should be free of any > > false positives. I have only compile tested it yet. > > That looks fine, can't say immediately if fully correct. I think you'll > need to bump SECTION_NID_SHIFT as well and make sure things still fit? > Otherwise looks like nobody needed a new section bit since 2005, so we > should be fine. You are absolutely right. Thanks for spotting this! I have folded this in diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 611ff869fa4d..c412e6a3a1e9 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -1166,7 +1166,7 @@ extern unsigned long usemap_size(void); #define SECTION_IS_ONLINE (1UL<<2) #define SECTION_MAP_LAST_BIT (1UL<<3) #define SECTION_MAP_MASK (~(SECTION_MAP_LAST_BIT-1)) -#define SECTION_NID_SHIFT 2 +#define SECTION_NID_SHIFT 3 static inline struct page *__section_mem_map_addr(struct mem_section *section) { -- Michal Hocko SUSE Labs