All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: numa: mm: kill double initialization for NODE_DATA
@ 2013-04-02 10:14 ` Lin Feng
  0 siblings, 0 replies; 8+ messages in thread
From: Lin Feng @ 2013-04-02 10:14 UTC (permalink / raw)
  To: tglx, mingo, hpa, akpm
  Cc: linux-mm, x86, linux-kernel, yinghai, wency, tangchen, Lin Feng

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@cn.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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH] x86: numa: mm: kill double initialization for NODE_DATA
@ 2013-04-02 10:14 ` Lin Feng
  0 siblings, 0 replies; 8+ messages in thread
From: Lin Feng @ 2013-04-02 10:14 UTC (permalink / raw)
  To: tglx, mingo, hpa, akpm
  Cc: linux-mm, x86, linux-kernel, yinghai, wency, tangchen, Lin Feng

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@cn.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, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] x86: numa: mm: kill double initialization for NODE_DATA
  2013-04-02 10:14 ` Lin Feng
  (?)
@ 2013-04-02 10:57 ` Wanpeng Li
  2013-04-03  1:54     ` Lin Feng
  -1 siblings, 1 reply; 8+ messages in thread
From: Wanpeng Li @ 2013-04-02 10:57 UTC (permalink / raw)
  To: Lin Feng
  Cc: tglx, mingo, hpa, akpm, linux-mm, x86, linux-kernel, yinghai,
	wency, tangchen

On Tue, Apr 02, 2013 at 06:14:35PM +0800, Lin Feng wrote:
>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;
>

You miss the nodes which could become online at some point, but not
online currently. 

Regards,
Wanpeng Li 

>
>Signed-off-by: Lin Feng <linfeng@cn.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, send a message with 'unsubscribe linux-mm' in
>the body to majordomo@kvack.org.  For more info on Linux MM,
>see: http://www.linux-mm.org/ .
>Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] x86: numa: mm: kill double initialization for NODE_DATA
  2013-04-02 10:14 ` Lin Feng
  (?)
  (?)
@ 2013-04-02 10:57 ` Wanpeng Li
  -1 siblings, 0 replies; 8+ messages in thread
From: Wanpeng Li @ 2013-04-02 10:57 UTC (permalink / raw)
  To: Lin Feng
  Cc: tglx, mingo, hpa, akpm, linux-mm, x86, linux-kernel, yinghai,
	wency, tangchen

On Tue, Apr 02, 2013 at 06:14:35PM +0800, Lin Feng wrote:
>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;
>

You miss the nodes which could become online at some point, but not
online currently. 

Regards,
Wanpeng Li 

>
>Signed-off-by: Lin Feng <linfeng@cn.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, send a message with 'unsubscribe linux-mm' in
>the body to majordomo@kvack.org.  For more info on Linux MM,
>see: http://www.linux-mm.org/ .
>Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] x86: numa: mm: kill double initialization for NODE_DATA
  2013-04-02 10:57 ` Wanpeng Li
@ 2013-04-03  1:54     ` Lin Feng
  0 siblings, 0 replies; 8+ messages in thread
From: Lin Feng @ 2013-04-03  1:54 UTC (permalink / raw)
  To: Wanpeng Li
  Cc: tglx, mingo, hpa, akpm, linux-mm, x86, linux-kernel, yinghai,
	wency, tangchen

Hi Wanpeng,

On 04/02/2013 06:57 PM, Wanpeng Li wrote:
>> >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;
>> >
> You miss the nodes which could become online at some point, but not
> online currently. 

Sorry, I'm not quite understanding what you said.

I keep node_set_online(nid) there. In boot phase if a node is online now it wil be 
reinitialized later by zone_sizes_init() else if a node is hotpluged after system is
up it will also be initialized by hotadd_new_pgdat() which falls into calling 
free_area_init_node().

Besides this I'm not sure there are any other dependency besides what you worry about,
while I tested this on a x86_64 numa system with hot-add nodes and the meminfo statics
looks right before and after hot-add memory.

thanks for your patient,
linfeng

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] x86: numa: mm: kill double initialization for NODE_DATA
@ 2013-04-03  1:54     ` Lin Feng
  0 siblings, 0 replies; 8+ messages in thread
From: Lin Feng @ 2013-04-03  1:54 UTC (permalink / raw)
  To: Wanpeng Li
  Cc: tglx, mingo, hpa, akpm, linux-mm, x86, linux-kernel, yinghai,
	wency, tangchen

Hi Wanpeng,

On 04/02/2013 06:57 PM, Wanpeng Li wrote:
>> >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;
>> >
> You miss the nodes which could become online at some point, but not
> online currently. 

Sorry, I'm not quite understanding what you said.

I keep node_set_online(nid) there. In boot phase if a node is online now it wil be 
reinitialized later by zone_sizes_init() else if a node is hotpluged after system is
up it will also be initialized by hotadd_new_pgdat() which falls into calling 
free_area_init_node().

Besides this I'm not sure there are any other dependency besides what you worry about,
while I tested this on a x86_64 numa system with hot-add nodes and the meminfo statics
looks right before and after hot-add memory.

thanks for your patient,
linfeng

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] x86: numa: mm: kill double initialization for NODE_DATA
  2013-04-03  1:54     ` Lin Feng
  (?)
@ 2013-04-07  1:17     ` Wanpeng Li
  -1 siblings, 0 replies; 8+ messages in thread
From: Wanpeng Li @ 2013-04-07  1:17 UTC (permalink / raw)
  To: Lin Feng
  Cc: tglx, mingo, hpa, akpm, linux-mm, x86, linux-kernel, yinghai,
	wency, tangchen

On Wed, Apr 03, 2013 at 09:54:33AM +0800, Lin Feng wrote:
>Hi Wanpeng,
>
>On 04/02/2013 06:57 PM, Wanpeng Li wrote:
>>> >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;
>>> >
>> You miss the nodes which could become online at some point, but not
>> online currently. 
>

Hi Feng,

>Sorry, I'm not quite understanding what you said.
>
>I keep node_set_online(nid) there. In boot phase if a node is online now it wil be 
>reinitialized later by zone_sizes_init() else if a node is hotpluged after system is
>up it will also be initialized by hotadd_new_pgdat() which falls into calling 
>free_area_init_node().

I miss it.

>
>Besides this I'm not sure there are any other dependency besides what you worry about,
>while I tested this on a x86_64 numa system with hot-add nodes and the meminfo statics
>looks right before and after hot-add memory.

Fair enough. ;-)

Regards,
Wanpeng Li 

>
>thanks for your patient,
>linfeng

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] x86: numa: mm: kill double initialization for NODE_DATA
  2013-04-03  1:54     ` Lin Feng
  (?)
  (?)
@ 2013-04-07  1:17     ` Wanpeng Li
  -1 siblings, 0 replies; 8+ messages in thread
From: Wanpeng Li @ 2013-04-07  1:17 UTC (permalink / raw)
  Cc: tglx, mingo, hpa, akpm, linux-mm, x86, linux-kernel, yinghai,
	wency, tangchen, Lin Feng

On Wed, Apr 03, 2013 at 09:54:33AM +0800, Lin Feng wrote:
>Hi Wanpeng,
>
>On 04/02/2013 06:57 PM, Wanpeng Li wrote:
>>> >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;
>>> >
>> You miss the nodes which could become online at some point, but not
>> online currently. 
>

Hi Feng,

>Sorry, I'm not quite understanding what you said.
>
>I keep node_set_online(nid) there. In boot phase if a node is online now it wil be 
>reinitialized later by zone_sizes_init() else if a node is hotpluged after system is
>up it will also be initialized by hotadd_new_pgdat() which falls into calling 
>free_area_init_node().

I miss it.

>
>Besides this I'm not sure there are any other dependency besides what you worry about,
>while I tested this on a x86_64 numa system with hot-add nodes and the meminfo statics
>looks right before and after hot-add memory.

Fair enough. ;-)

Regards,
Wanpeng Li 

>
>thanks for your patient,
>linfeng

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-04-07  1:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-02 10:14 [PATCH] x86: numa: mm: kill double initialization for NODE_DATA Lin Feng
2013-04-02 10:14 ` Lin Feng
2013-04-02 10:57 ` Wanpeng Li
2013-04-03  1:54   ` Lin Feng
2013-04-03  1:54     ` Lin Feng
2013-04-07  1:17     ` Wanpeng Li
2013-04-07  1:17     ` Wanpeng Li
2013-04-02 10:57 ` Wanpeng Li

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.