From patchwork Mon Jul 9 17:53:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Tatashin X-Patchwork-Id: 10515469 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 82D7160318 for ; Mon, 9 Jul 2018 17:53:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 71FE128D04 for ; Mon, 9 Jul 2018 17:53:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 661D628D78; Mon, 9 Jul 2018 17:53:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 260C228D04 for ; Mon, 9 Jul 2018 17:53:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8EA746B031C; Mon, 9 Jul 2018 13:53:32 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 6251F6B031F; Mon, 9 Jul 2018 13:53:32 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 429D66B031D; Mon, 9 Jul 2018 13:53:32 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ua0-f197.google.com (mail-ua0-f197.google.com [209.85.217.197]) by kanga.kvack.org (Postfix) with ESMTP id 0E8816B031C for ; Mon, 9 Jul 2018 13:53:32 -0400 (EDT) Received: by mail-ua0-f197.google.com with SMTP id n10-v6so2317302uao.1 for ; Mon, 09 Jul 2018 10:53:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:subject:date:message-id :in-reply-to:references; bh=9z1m/6M/pcueKoyO08yZl2pERuqwb76tqTeWyUIy3HM=; b=KlzN5ZlRFumOaC0uvS1xKCLuMJZW/rWgUKuSu8HmujCwObxaFN9HhM2G1vli/TGGQj UNGJxwXCveav5uoUbeH5qE/3A9NowQvD1iA2OzzI2q8dZ+v/LkW8CymeZbaveUbj3mO/ 6VfsvO1N9HDeLrB2dEByJjNl22My7ZMkLHkOd0dFcEJe6gufE4QaZ8sGVbEiSfl2fgh4 fTKt2muJzw0rd0yCVA48E23FoKNgve5lzkAoboKJauGxauw1eVWEyWq0I2y+4dWK6wD+ /zoelr59CohhTuGB21azzjOECf7Dofutm8pHVRHQhesz0u1vJtK5SJKFS2ZlwPL+GYZt acUQ== X-Gm-Message-State: APt69E2fgs6+1saqJYXmioMdxyKOnv143r/V7lWTLLzYBaO4mtknOZlZ u7a0FIwaK8gTjx9zcq7KV0PwwLxKQoDwlqnDu+zPo1pxdX9PvqHJXRkTUwoh7pxD8M1Rn+FQbDS FdZMYrucEci640B7yMuZXJrBKBpLlE94QXfkcsbLWnWwdsBFwvgK5CJt1kov0L33cGQ== X-Received: by 2002:a1f:2cce:: with SMTP id s197-v6mr11967916vks.106.1531158811712; Mon, 09 Jul 2018 10:53:31 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdPcKHNVREYfOmSeanveMn5cMvFPZ/Hsowjfpp4F7O7W358VUVP/Y9A2Lq7JCxXF6cGq8l6 X-Received: by 2002:a1f:2cce:: with SMTP id s197-v6mr11967895vks.106.1531158810631; Mon, 09 Jul 2018 10:53:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531158810; cv=none; d=google.com; s=arc-20160816; b=Vncvo6VgqZFG6+C63jIFF96D0Zv/X1t9NccKp8XhHX8EUId+7ZiC7WqN0mp/hhaoSK 2IdCawRzxJL/QJrt/QkChl89mthHjP3nc0SXYKS8xqUSHZqCSJdKl0wqKwFWklyXwNYR +hEqQePwn++EAiL7IixVF2H+Xol7J07LeA5WOE75SvS8kkWrkWMMk/ryru8ErD/VGKSj yLoZppowa6p8Pzy+nSq3Jg9T5saB0K0a7AMlofbJ2ECtpjfqKQlrFlbYPWB70Q0DnxDW PruOSWKljgvt2bGO1Wm4NBuTvYRdMTQuBvNXX0WD6IzJsJXtV479vQiwsl3WzSPckNIH Uq+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:to:from :dkim-signature:arc-authentication-results; bh=9z1m/6M/pcueKoyO08yZl2pERuqwb76tqTeWyUIy3HM=; b=YwYVgaWI67L+nBzIJGozT4Si4EmW+2QWt3Ll3CEm0iG4nrnxmZGX6w4xFWUxJKrZ6e hh/4FucoKUYbvydPV5UDO3R7uJqNaTpH0GldLfR9MKoswgjb6JrvtJTSwOSwlaM1+Zda uVGuG/3NNwUK8HJRsgNNSvSG79el1hdvRGt4s/cAy2PqgIPaouspw3pmYoT9/edzzPqh Ckp1F7KXZU5bPlrJ4jIV/5myKVoqry5s7JrEx3lpZpy8PoOHnIP7qHRfG/AMrQ0Y6qnQ nt/4UVy7RwasnpPobJuv6atD5PHg9A8WyIa09QeOqWP9KqaFMDLWTpe6DpVFzZUs/TXa Zvxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=QQMCdnv3; spf=pass (google.com: domain of pasha.tatashin@oracle.com designates 141.146.126.78 as permitted sender) smtp.mailfrom=pasha.tatashin@oracle.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from aserp2120.oracle.com (aserp2120.oracle.com. [141.146.126.78]) by mx.google.com with ESMTPS id 63-v6si6522752ual.41.2018.07.09.10.53.30 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Jul 2018 10:53:30 -0700 (PDT) Received-SPF: pass (google.com: domain of pasha.tatashin@oracle.com designates 141.146.126.78 as permitted sender) client-ip=141.146.126.78; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=QQMCdnv3; spf=pass (google.com: domain of pasha.tatashin@oracle.com designates 141.146.126.78 as permitted sender) smtp.mailfrom=pasha.tatashin@oracle.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w69Hn1oG103060; Mon, 9 Jul 2018 17:53:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references; s=corp-2018-07-02; bh=9z1m/6M/pcueKoyO08yZl2pERuqwb76tqTeWyUIy3HM=; b=QQMCdnv3CMLC3aoVWQJ6A2soEJHSy3HaCrXVgfIfaKsKO/nfTpaEjMFFrZmHxKzTPkF9 18UAlVLo7Tni1Yh87W2WN31zomEDxGjww4LxJt83DCHGCX0g7EbEDQ0UQn/us3e5OEsp eag+rpfeQBrW3Vop4CkRASr7hy5tFjxoB8PhJPSKpyzjMnptUU+QusbouB5YyJfSdRkc aN1LKcA0UjYjneehW/YdFw59KwqK/MuGj5kWVgJbZ76c1RdJBkvQHlwskrgDgpIYrqj6 iSzfSpwig50h9po6Mh5QPMoNXKpKiOf04TipKzlW3ki6WkEBYNqhkrhFc+9gi5Nq4OZ2 /Q== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2120.oracle.com with ESMTP id 2k2p7dna0a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 09 Jul 2018 17:53:25 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w69HrOS0000338 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 9 Jul 2018 17:53:24 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w69HrN65002003; Mon, 9 Jul 2018 17:53:23 GMT Received: from xakep.us.oracle.com (/10.154.140.248) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 09 Jul 2018 10:53:23 -0700 From: Pavel Tatashin To: steven.sistare@oracle.com, daniel.m.jordan@oracle.com, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, kirill.shutemov@linux.intel.com, mhocko@suse.com, linux-mm@kvack.org, dan.j.williams@intel.com, jack@suse.cz, jglisse@redhat.com, jrdr.linux@gmail.com, bhe@redhat.com, gregkh@linuxfoundation.org, vbabka@suse.cz, richard.weiyang@gmail.com, dave.hansen@intel.com, rientjes@google.com, mingo@kernel.org, osalvador@techadventures.net, pasha.tatashin@oracle.com Subject: [PATCH v4 2/3] mm/sparse: start using sparse_init_nid(), and remove old code Date: Mon, 9 Jul 2018 13:53:11 -0400 Message-Id: <20180709175312.11155-3-pasha.tatashin@oracle.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180709175312.11155-1-pasha.tatashin@oracle.com> References: <20180709175312.11155-1-pasha.tatashin@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8949 signatures=668705 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=2 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807090202 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Change sprase_init() to only find the pnum ranges that belong to a specific node and call sprase_init_nid() for that range from sparse_init(). Delete all the code that became obsolete with this change. Signed-off-by: Pavel Tatashin Reviewed-by: Oscar Salvador --- include/linux/mm.h | 5 - mm/sparse-vmemmap.c | 39 -------- mm/sparse.c | 222 ++++---------------------------------------- 3 files changed, 19 insertions(+), 247 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 5fdea58e67a5..cb49611d1199 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2646,11 +2646,6 @@ extern int randomize_va_space; const char * arch_vma_name(struct vm_area_struct *vma); void print_vma_addr(char *prefix, unsigned long rip); -void sparse_mem_maps_populate_node(struct page **map_map, - unsigned long pnum_begin, - unsigned long pnum_end, - unsigned long map_count, - int nodeid); struct page *sparse_populate_node(unsigned long pnum_begin, unsigned long pnum_end, unsigned long map_count, diff --git a/mm/sparse-vmemmap.c b/mm/sparse-vmemmap.c index f91056bfe972..87ba7cf8c75b 100644 --- a/mm/sparse-vmemmap.c +++ b/mm/sparse-vmemmap.c @@ -273,45 +273,6 @@ struct page * __meminit sparse_mem_map_populate(unsigned long pnum, int nid, return map; } -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) -{ - unsigned long pnum; - unsigned long size = sizeof(struct page) * PAGES_PER_SECTION; - void *vmemmap_buf_start; - int nr_consumed_maps = 0; - - size = ALIGN(size, PMD_SIZE); - vmemmap_buf_start = __earlyonly_bootmem_alloc(nodeid, size * map_count, - PMD_SIZE, __pa(MAX_DMA_ADDRESS)); - - if (vmemmap_buf_start) { - vmemmap_buf = vmemmap_buf_start; - vmemmap_buf_end = vmemmap_buf_start + size * map_count; - } - - for (pnum = pnum_begin; pnum < pnum_end; pnum++) { - if (!present_section_nr(pnum)) - continue; - - map_map[nr_consumed_maps] = sparse_mem_map_populate(pnum, nodeid, NULL); - if (map_map[nr_consumed_maps++]) - continue; - pr_err("%s: sparsemem memory map backing failed some memory will not be available\n", - __func__); - } - - if (vmemmap_buf_start) { - /* need to free left buf */ - memblock_free_early(__pa(vmemmap_buf), - vmemmap_buf_end - vmemmap_buf); - vmemmap_buf = NULL; - vmemmap_buf_end = NULL; - } -} - /* * Allocate struct pages for every section in nid node. Number of present * sections is specified by map_count, and range is [pnum_begin, pnum_end). diff --git a/mm/sparse.c b/mm/sparse.c index 3cf66bfb6b81..629e0d979333 100644 --- a/mm/sparse.c +++ b/mm/sparse.c @@ -200,11 +200,10 @@ static inline int next_present_section_nr(int section_nr) (section_nr <= __highest_present_section_nr)); \ section_nr = next_present_section_nr(section_nr)) -/* - * Record how many memory sections are marked as present - * during system bootup. - */ -static int __initdata nr_present_sections; +static inline unsigned long first_present_section_nr(void) +{ + return next_present_section_nr(-1); +} /* Record a memory area against a node. */ void __init memory_present(int nid, unsigned long start, unsigned long end) @@ -235,7 +234,6 @@ void __init memory_present(int nid, unsigned long start, unsigned long end) ms->section_mem_map = sparse_encode_early_nid(nid) | SECTION_IS_ONLINE; section_mark_present(ms); - nr_present_sections++; } } } @@ -377,34 +375,6 @@ static void __init check_usemap_section_nr(int nid, unsigned long *usemap) } #endif /* CONFIG_MEMORY_HOTREMOVE */ -static void __init sparse_early_usemaps_alloc_node(void *data, - unsigned long pnum_begin, - unsigned long pnum_end, - unsigned long usemap_count, int nodeid) -{ - void *usemap; - unsigned long pnum; - unsigned long **usemap_map = (unsigned long **)data; - int size = usemap_size(); - int nr_consumed_maps = 0; - - usemap = sparse_early_usemaps_alloc_pgdat_section(NODE_DATA(nodeid), - size * usemap_count); - if (!usemap) { - pr_warn("%s: allocation failed\n", __func__); - return; - } - - for (pnum = pnum_begin; pnum < pnum_end; pnum++) { - if (!present_section_nr(pnum)) - continue; - usemap_map[nr_consumed_maps] = usemap; - usemap += size; - check_usemap_section_nr(nodeid, usemap_map[nr_consumed_maps]); - nr_consumed_maps++; - } -} - #ifndef CONFIG_SPARSEMEM_VMEMMAP struct page __init *sparse_mem_map_populate(unsigned long pnum, int nid, struct vmem_altmap *altmap) @@ -418,44 +388,6 @@ struct page __init *sparse_mem_map_populate(unsigned long pnum, int nid, BOOTMEM_ALLOC_ACCESSIBLE, nid); return map; } -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) -{ - void *map; - unsigned long pnum; - unsigned long size = sizeof(struct page) * PAGES_PER_SECTION; - int nr_consumed_maps; - - size = PAGE_ALIGN(size); - map = memblock_virt_alloc_try_nid_raw(size * map_count, - PAGE_SIZE, __pa(MAX_DMA_ADDRESS), - BOOTMEM_ALLOC_ACCESSIBLE, nodeid); - if (map) { - nr_consumed_maps = 0; - for (pnum = pnum_begin; pnum < pnum_end; pnum++) { - if (!present_section_nr(pnum)) - continue; - map_map[nr_consumed_maps] = map; - map += size; - nr_consumed_maps++; - } - return; - } - - /* fallback */ - nr_consumed_maps = 0; - for (pnum = pnum_begin; pnum < pnum_end; pnum++) { - if (!present_section_nr(pnum)) - continue; - map_map[nr_consumed_maps] = sparse_mem_map_populate(pnum, nodeid, NULL); - if (map_map[nr_consumed_maps++]) - continue; - pr_err("%s: sparsemem memory map backing failed some memory will not be available\n", - __func__); - } -} static unsigned long __init section_map_size(void) { @@ -495,73 +427,15 @@ struct page * __init sparse_populate_node_section(struct page *map_base, } #endif /* !CONFIG_SPARSEMEM_VMEMMAP */ -static void __init sparse_early_mem_maps_alloc_node(void *data, - unsigned long pnum_begin, - unsigned long pnum_end, - unsigned long map_count, int nodeid) -{ - struct page **map_map = (struct page **)data; - sparse_mem_maps_populate_node(map_map, pnum_begin, pnum_end, - map_count, nodeid); -} - void __weak __meminit vmemmap_populate_print_last(void) { } -/** - * alloc_usemap_and_memmap - memory alloction for pageblock flags and vmemmap - * @map: usemap_map for pageblock flags or mmap_map for vmemmap - * @unit_size: size of map unit - */ -static void __init alloc_usemap_and_memmap(void (*alloc_func) - (void *, unsigned long, unsigned long, - unsigned long, int), void *data, - int data_unit_size) -{ - unsigned long pnum; - unsigned long map_count; - int nodeid_begin = 0; - unsigned long pnum_begin = 0; - - for_each_present_section_nr(0, pnum) { - struct mem_section *ms; - - ms = __nr_to_section(pnum); - nodeid_begin = sparse_early_nid(ms); - pnum_begin = pnum; - break; - } - map_count = 1; - for_each_present_section_nr(pnum_begin + 1, pnum) { - struct mem_section *ms; - int nodeid; - - ms = __nr_to_section(pnum); - nodeid = sparse_early_nid(ms); - if (nodeid == nodeid_begin) { - map_count++; - continue; - } - /* ok, we need to take cake of from pnum_begin to pnum - 1*/ - alloc_func(data, pnum_begin, pnum, - map_count, nodeid_begin); - /* new start, update count etc*/ - nodeid_begin = nodeid; - pnum_begin = pnum; - data += map_count * data_unit_size; - map_count = 1; - } - /* ok, last chunk */ - alloc_func(data, pnum_begin, __highest_present_section_nr+1, - map_count, nodeid_begin); -} - /* * Initialize sparse on a specific node. The node spans [pnum_begin, pnum_end) * And number of present sections in this node is map_count. */ -void __init sparse_init_nid(int nid, unsigned long pnum_begin, +static void __init sparse_init_nid(int nid, unsigned long pnum_begin, unsigned long pnum_end, unsigned long map_count) { @@ -617,87 +491,29 @@ void __init sparse_init_nid(int nid, unsigned long pnum_begin, */ void __init sparse_init(void) { - unsigned long pnum; - struct page *map; - struct page **map_map; - unsigned long *usemap; - unsigned long **usemap_map; - int size, size2; - int nr_consumed_maps = 0; - - /* see include/linux/mmzone.h 'struct mem_section' definition */ - BUILD_BUG_ON(!is_power_of_2(sizeof(struct mem_section))); + unsigned long pnum_begin = first_present_section_nr(); + int nid_begin = sparse_early_nid(__nr_to_section(pnum_begin)); + unsigned long pnum_end, map_count = 1; /* Setup pageblock_order for HUGETLB_PAGE_SIZE_VARIABLE */ set_pageblock_order(); - /* - * map is using big page (aka 2M in x86 64 bit) - * usemap is less one page (aka 24 bytes) - * so alloc 2M (with 2M align) and 24 bytes in turn will - * make next 2M slip to one more 2M later. - * then in big system, the memory will have a lot of holes... - * here try to allocate 2M pages continuously. - * - * powerpc need to call sparse_init_one_section right after each - * sparse_early_mem_map_alloc, so allocate usemap_map at first. - */ - size = sizeof(unsigned long *) * nr_present_sections; - usemap_map = memblock_virt_alloc(size, 0); - if (!usemap_map) - panic("can not allocate usemap_map\n"); - alloc_usemap_and_memmap(sparse_early_usemaps_alloc_node, - (void *)usemap_map, - sizeof(usemap_map[0])); - - size2 = sizeof(struct page *) * nr_present_sections; - map_map = memblock_virt_alloc(size2, 0); - if (!map_map) - panic("can not allocate map_map\n"); - alloc_usemap_and_memmap(sparse_early_mem_maps_alloc_node, - (void *)map_map, - sizeof(map_map[0])); - - /* The numner of present sections stored in nr_present_sections - * are kept the same since mem sections are marked as present in - * memory_present(). In this for loop, we need check which sections - * failed to allocate memmap or usemap, then clear its - * ->section_mem_map accordingly. During this process, we need - * increase 'nr_consumed_maps' whether its allocation of memmap - * or usemap failed or not, so that after we handle the i-th - * memory section, can get memmap and usemap of (i+1)-th section - * correctly. */ - for_each_present_section_nr(0, pnum) { - struct mem_section *ms; - - if (nr_consumed_maps >= nr_present_sections) { - pr_err("nr_consumed_maps goes beyond nr_present_sections\n"); - break; - } - ms = __nr_to_section(pnum); - usemap = usemap_map[nr_consumed_maps]; - if (!usemap) { - ms->section_mem_map = 0; - nr_consumed_maps++; - continue; - } + for_each_present_section_nr(pnum_begin + 1, pnum_end) { + int nid = sparse_early_nid(__nr_to_section(pnum_end)); - map = map_map[nr_consumed_maps]; - if (!map) { - ms->section_mem_map = 0; - nr_consumed_maps++; + if (nid == nid_begin) { + map_count++; continue; } - - sparse_init_one_section(__nr_to_section(pnum), pnum, map, - usemap); - nr_consumed_maps++; + /* Init node with sections in range [pnum_begin, pnum_end) */ + sparse_init_nid(nid_begin, pnum_begin, pnum_end, map_count); + nid_begin = nid; + pnum_begin = pnum_end; + map_count = 1; } - + /* cover the last node */ + sparse_init_nid(nid_begin, pnum_begin, pnum_end, map_count); vmemmap_populate_print_last(); - - memblock_free_early(__pa(map_map), size2); - memblock_free_early(__pa(usemap_map), size); } #ifdef CONFIG_MEMORY_HOTPLUG