lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Tue, 2 Apr 2013 18:14:35 +0800
From:	Lin Feng <linfeng@...fujitsu.com>
To:	tglx@...utronix.de, mingo@...hat.com, hpa@...or.com,
	akpm@...ux-foundation.org
Cc:	linux-mm@...ck.org, x86@...nel.org, linux-kernel@...r.kernel.org,
	yinghai@...nel.org, wency@...fujitsu.com, tangchen@...fujitsu.com,
	Lin Feng <linfeng@...fujitsu.com>
Subject: [PATCH] x86: numa: mm: kill double initialization for NODE_DATA

We initialize node_id, node_start_pfn and node_spanned_pages for NODE_DATA in
initmem_init() while the later two members are kept unused and will be
recaculated soon in paging_init(), so remove the useless assignments.

PS. For clarifying calling chains are showed as follows:
setup_arch()
  ...
  initmem_init()
    x86_numa_init()
      numa_init()
        numa_register_memblks()
          setup_node_data()
            NODE_DATA(nid)->node_id = nid;
            NODE_DATA(nid)->node_start_pfn = start >> PAGE_SHIFT;
            NODE_DATA(nid)->node_spanned_pages = (end - start) >> PAGE_SHIFT;
  ...
  x86_init.paging.pagetable_init()
  paging_init()
    ...
    sparse_init()
      sparse_early_usemaps_alloc_node()
        sparse_early_usemaps_alloc_pgdat_section()
          ___alloc_bootmem_node_nopanic()
            __alloc_memory_core_early(pgdat->node_id,...)
    ...
    zone_sizes_init()
      free_area_init_nodes()
        free_area_init_node()
          pgdat->node_id = nid;
          pgdat->node_start_pfn = node_start_pfn;
          calculate_node_totalpages();
            pgdat->node_spanned_pages = totalpages;


Signed-off-by: Lin Feng <linfeng@...fujitsu.com>
---
 arch/x86/mm/numa.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c
index 72fe01e..efdd08f 100644
--- a/arch/x86/mm/numa.c
+++ b/arch/x86/mm/numa.c
@@ -230,8 +230,6 @@ static void __init setup_node_data(int nid, u64 start, u64 end)
 	node_data[nid] = nd;
 	memset(NODE_DATA(nid), 0, sizeof(pg_data_t));
 	NODE_DATA(nid)->node_id = nid;
-	NODE_DATA(nid)->node_start_pfn = start >> PAGE_SHIFT;
-	NODE_DATA(nid)->node_spanned_pages = (end - start) >> PAGE_SHIFT;
 
 	node_set_online(nid);
 }
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ