Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3428864imm; Sun, 1 Jul 2018 21:42:39 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc3EZZAujhW+etkHgQ5weJhDEW/uULu6x/lamUFFV+Mn+9j+CbE/ECINGK0wBJy0Hae/Bd5 X-Received: by 2002:a17:902:7106:: with SMTP id a6-v6mr7336906pll.28.1530506559109; Sun, 01 Jul 2018 21:42:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530506559; cv=none; d=google.com; s=arc-20160816; b=C6AcHUsL24BTipLTWTTeT+ECAjIhmOJA7NwfIM7vs2E4Km4geKF5e1dOb1NYPhTNYy iWlkYaVX9V42d0ngZihCDhBiDA2W/Lt7ZI94ra6D4BoESpszMwYhiMqPmAJsTXuGjPa+ sTlSlj2nq8neESFDokOCH0+zAOGUuhD/Aub9/bADgUseAbQ8zZugIDni5B017/BYibnP YI9I8poRjIPWwQ9YwyaEYjrVdFc2yCg98N1fWR2kByZ3ABITqCZ8tgnzU+h/OscAARJ3 1uL/8bmbVlqMLlTEBBF64c5ZAc4x0n7B4UemuQ1iOTqpuWb9ueI/A6s3y7Ydkcir2Yqt NL9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=1wu7ihMPuoAnLQr2s+61rV4OwGtcdnoKQ+ere0Uk2zo=; b=i96tfS3c4YQbm1B9wubQgOhJCg1EfBRYaYmS8movFSzSWLrpafb9hzhVPwJtQCRYmx nc41+4eQ30jUu0V5UDGoh4rJGcsQqn2CkbTV86/99aAofJucSaqYBULA//7FMf0K7U80 MMBapiec5Udxfo+djEikwppj8IBmjx7brZ0KuBDeACtu+ZdcErDrMlvMia+VVnuWZ+Lj 7NukBDJDPgNJXMPhGQWFtjmUTxJ03dyalaIBxXti0fbOnGcXhS4NFzNbS2n79cMH6XjO 8ZeIxfgNnonaGN7tX/t9tGvo2J103cwLxsF/uWZceU29pnLIVYioBDoGEXmzqpMteSWq kVIA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b76-v6si13083539pfl.223.2018.07.01.21.42.23; Sun, 01 Jul 2018 21:42:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932971AbeGBDR1 (ORCPT + 99 others); Sun, 1 Jul 2018 23:17:27 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:58198 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752937AbeGBDR0 (ORCPT ); Sun, 1 Jul 2018 23:17:26 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6081381663D1; Mon, 2 Jul 2018 03:17:25 +0000 (UTC) Received: from localhost (ovpn-8-16.pek2.redhat.com [10.72.8.16]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A0D672156880; Mon, 2 Jul 2018 03:17:24 +0000 (UTC) Date: Mon, 2 Jul 2018 11:17:21 +0800 From: Baoquan He 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 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> User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Mon, 02 Jul 2018 03:17:25 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Mon, 02 Jul 2018 03:17:25 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'bhe@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; > } > ... > } >