From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk0-f199.google.com (mail-qk0-f199.google.com [209.85.220.199]) by kanga.kvack.org (Postfix) with ESMTP id 9865B6B0006 for ; Sun, 1 Jul 2018 23:17:26 -0400 (EDT) Received: by mail-qk0-f199.google.com with SMTP id l62-v6so17689963qkb.21 for ; Sun, 01 Jul 2018 20:17:26 -0700 (PDT) Received: from mx1.redhat.com (mx3-rdu2.redhat.com. [66.187.233.73]) by mx.google.com with ESMTPS id q8-v6si2927346qkl.141.2018.07.01.20.17.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Jul 2018 20:17:25 -0700 (PDT) Date: Mon, 2 Jul 2018 11:17:21 +0800 From: Baoquan He Subject: Re: [PATCH v3 1/2] mm/sparse: add sparse_init_nid() Message-ID: <20180702031721.GQ3223@MiWiFi-R3L-srv> References: <20180702020417.21281-1-pasha.tatashin@oracle.com> <20180702020417.21281-2-pasha.tatashin@oracle.com> <20180702021121.GL3223@MiWiFi-R3L-srv> <20180702023130.GM3223@MiWiFi-R3L-srv> <20180702025343.GN3223@MiWiFi-R3L-srv> <20180702031417.GP3223@MiWiFi-R3L-srv> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180702031417.GP3223@MiWiFi-R3L-srv> Sender: owner-linux-mm@kvack.org List-ID: To: Pavel Tatashin Cc: Steven Sistare , Daniel Jordan , LKML , Andrew Morton , kirill.shutemov@linux.intel.com, Michal Hocko , Linux Memory Management List , dan.j.williams@intel.com, jack@suse.cz, jglisse@redhat.com, Souptick Joarder , gregkh@linuxfoundation.org, Vlastimil Babka , Wei Yang , dave.hansen@intel.com, rientjes@google.com, mingo@kernel.org, osalvador@techadventures.net On 07/02/18 at 11:14am, Baoquan He wrote: > On 07/01/18 at 11:03pm, Pavel Tatashin wrote: > > > Ah, yes, I misunderstood it, sorry for that. > > > > > > Then I have only one concern, for vmemmap case, if one section doesn't > > > succeed to populate its memmap, do we need to skip all the remaining > > > sections in that node? > > > > Yes, in sparse_populate_node() we have the following: > > > > 294 for (pnum = pnum_begin; map_index < map_count; pnum++) { > > 295 if (!present_section_nr(pnum)) > > 296 continue; > > 297 if (!sparse_mem_map_populate(pnum, nid, NULL)) > > 298 break; > > > > So, on the first failure, we even stop trying to populate other > > sections. No more memory to do so. > > This is the thing I worry about. In old sparse_mem_maps_populate_node() > you can see, when not present or failed to populate, just continue. This > is the main difference between yours and the old code. The key logic is > changed here. > Forgot mentioning it's the vervion in mm/sparse-vmemmap.c > void __init sparse_mem_maps_populate_node(struct page **map_map, > unsigned long pnum_begin, > unsigned long pnum_end, > unsigned long map_count, int nodeid) > { > ... > for (pnum = pnum_begin; pnum < pnum_end; pnum++) { > struct mem_section *ms; > > if (!present_section_nr(pnum)) > continue; > > map_map[pnum] = sparse_mem_map_populate(pnum, nodeid, NULL); > if (map_map[pnum]) > continue; > ms = __nr_to_section(pnum); > pr_err("%s: sparsemem memory map backing failed some memory will not be available\n", > __func__); > ms->section_mem_map = 0; > } > ... > } >