Re: [patch] mm: speedup in __early_pfn_to_nid

2013-03-26 Thread Ingo Molnar
* Andrew Morton wrote: > On Thu, 21 Mar 2013 19:03:21 +0100 Ingo Molnar wrote: > > > > IMO the local scope is more obvious as this is and should only be > > > used for caching purposes. > > > > It's a pattern we actively avoid in kernel code. > > On the contrary, I always encourage people

Re: [patch] mm: speedup in __early_pfn_to_nid

2013-03-26 Thread Ingo Molnar
* Andrew Morton a...@linux-foundation.org wrote: On Thu, 21 Mar 2013 19:03:21 +0100 Ingo Molnar mi...@kernel.org wrote: IMO the local scope is more obvious as this is and should only be used for caching purposes. It's a pattern we actively avoid in kernel code. On the contrary,

Re: [patch] mm: speedup in __early_pfn_to_nid

2013-03-25 Thread Andrew Morton
On Mon, 25 Mar 2013 15:36:54 -0700 (PDT) David Rientjes wrote: > On Mon, 25 Mar 2013, Andrew Morton wrote: > > > > Um, defining them in a __meminit function places them in .meminit.data > > > already. > > > > I wish it did, but it doesn't. > > > > $ objdump -t mm/page_alloc.o | grep

Re: [patch] mm: speedup in __early_pfn_to_nid

2013-03-25 Thread David Rientjes
On Mon, 25 Mar 2013, Andrew Morton wrote: > > Um, defining them in a __meminit function places them in .meminit.data > > already. > > I wish it did, but it doesn't. > $ objdump -t mm/page_alloc.o | grep last_start_pfn 0240 l O .meminit.data 0008

Re: [patch] mm: speedup in __early_pfn_to_nid

2013-03-25 Thread Yinghai Lu
On Mon, Mar 25, 2013 at 2:56 PM, Russ Anderson wrote: > On Mon, Mar 25, 2013 at 10:11:27AM +0800, Lin Feng wrote: >> On 03/24/2013 04:37 AM, Yinghai Lu wrote: >> > +#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP >> > +int __init_memblock memblock_search_pfn_nid(unsigned long pfn, >> > +

Re: [patch] mm: speedup in __early_pfn_to_nid

2013-03-25 Thread Russ Anderson
On Mon, Mar 25, 2013 at 10:11:27AM +0800, Lin Feng wrote: > On 03/24/2013 04:37 AM, Yinghai Lu wrote: > > +#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP > > +int __init_memblock memblock_search_pfn_nid(unsigned long pfn, > > +unsigned long *start_pfn, unsigned long *end_pfn) > > +{ > >

Re: [patch] mm: speedup in __early_pfn_to_nid

2013-03-25 Thread Andrew Morton
On Sun, 24 Mar 2013 17:28:12 -0700 (PDT) David Rientjes wrote: > On Sat, 23 Mar 2013, KOSAKI Motohiro wrote: > > > > --- linux.orig/mm/page_alloc.c 2013-03-19 16:09:03.736450861 -0500 > > > +++ linux/mm/page_alloc.c 2013-03-22 17:07:43.895405617 -0500 > > > @@ -4161,10 +4161,23 @@ int

Re: [patch] mm: speedup in __early_pfn_to_nid

2013-03-25 Thread Andrew Morton
On Thu, 21 Mar 2013 19:03:21 +0100 Ingo Molnar wrote: > > IMO the local scope is more obvious as this is and should only be used > > for caching purposes. > > It's a pattern we actively avoid in kernel code. On the contrary, I always encourage people to move the static definitions into

Re: [patch] mm: speedup in __early_pfn_to_nid

2013-03-25 Thread Andrew Morton
On Thu, 21 Mar 2013 19:03:21 +0100 Ingo Molnar mi...@kernel.org wrote: IMO the local scope is more obvious as this is and should only be used for caching purposes. It's a pattern we actively avoid in kernel code. On the contrary, I always encourage people to move the static definitions

Re: [patch] mm: speedup in __early_pfn_to_nid

2013-03-25 Thread Andrew Morton
On Sun, 24 Mar 2013 17:28:12 -0700 (PDT) David Rientjes rient...@google.com wrote: On Sat, 23 Mar 2013, KOSAKI Motohiro wrote: --- linux.orig/mm/page_alloc.c 2013-03-19 16:09:03.736450861 -0500 +++ linux/mm/page_alloc.c 2013-03-22 17:07:43.895405617 -0500 @@ -4161,10 +4161,23

Re: [patch] mm: speedup in __early_pfn_to_nid

2013-03-25 Thread Russ Anderson
On Mon, Mar 25, 2013 at 10:11:27AM +0800, Lin Feng wrote: On 03/24/2013 04:37 AM, Yinghai Lu wrote: +#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP +int __init_memblock memblock_search_pfn_nid(unsigned long pfn, +unsigned long *start_pfn, unsigned long *end_pfn) +{ + struct

Re: [patch] mm: speedup in __early_pfn_to_nid

2013-03-25 Thread Yinghai Lu
On Mon, Mar 25, 2013 at 2:56 PM, Russ Anderson r...@sgi.com wrote: On Mon, Mar 25, 2013 at 10:11:27AM +0800, Lin Feng wrote: On 03/24/2013 04:37 AM, Yinghai Lu wrote: +#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP +int __init_memblock memblock_search_pfn_nid(unsigned long pfn, +

Re: [patch] mm: speedup in __early_pfn_to_nid

2013-03-25 Thread David Rientjes
On Mon, 25 Mar 2013, Andrew Morton wrote: Um, defining them in a __meminit function places them in .meminit.data already. I wish it did, but it doesn't. $ objdump -t mm/page_alloc.o | grep last_start_pfn 0240 l O .meminit.data 0008 last_start_pfn.34345

Re: [patch] mm: speedup in __early_pfn_to_nid

2013-03-25 Thread Andrew Morton
On Mon, 25 Mar 2013 15:36:54 -0700 (PDT) David Rientjes rient...@google.com wrote: On Mon, 25 Mar 2013, Andrew Morton wrote: Um, defining them in a __meminit function places them in .meminit.data already. I wish it did, but it doesn't. $ objdump -t mm/page_alloc.o | grep

Re: [patch] mm: speedup in __early_pfn_to_nid

2013-03-24 Thread Lin Feng
On 03/24/2013 04:37 AM, Yinghai Lu wrote: > +#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP > +int __init_memblock memblock_search_pfn_nid(unsigned long pfn, > + unsigned long *start_pfn, unsigned long *end_pfn) > +{ > + struct memblock_type *type = > + int mid =

Re: [patch] mm: speedup in __early_pfn_to_nid

2013-03-24 Thread David Rientjes
On Sat, 23 Mar 2013, KOSAKI Motohiro wrote: > > --- linux.orig/mm/page_alloc.c 2013-03-19 16:09:03.736450861 -0500 > > +++ linux/mm/page_alloc.c 2013-03-22 17:07:43.895405617 -0500 > > @@ -4161,10 +4161,23 @@ int __meminit __early_pfn_to_nid(unsigne > > { > > unsigned long

Re: [patch] mm: speedup in __early_pfn_to_nid

2013-03-24 Thread Ingo Molnar
* Russ Anderson wrote: > --- linux.orig/mm/page_alloc.c2013-03-19 16:09:03.736450861 -0500 > +++ linux/mm/page_alloc.c 2013-03-22 17:07:43.895405617 -0500 > @@ -4161,10 +4161,23 @@ int __meminit __early_pfn_to_nid(unsigne > { > unsigned long start_pfn, end_pfn; > int i,

Re: [patch] mm: speedup in __early_pfn_to_nid

2013-03-24 Thread Ingo Molnar
* Russ Anderson r...@sgi.com wrote: --- linux.orig/mm/page_alloc.c2013-03-19 16:09:03.736450861 -0500 +++ linux/mm/page_alloc.c 2013-03-22 17:07:43.895405617 -0500 @@ -4161,10 +4161,23 @@ int __meminit __early_pfn_to_nid(unsigne { unsigned long start_pfn, end_pfn;

Re: [patch] mm: speedup in __early_pfn_to_nid

2013-03-24 Thread David Rientjes
On Sat, 23 Mar 2013, KOSAKI Motohiro wrote: --- linux.orig/mm/page_alloc.c 2013-03-19 16:09:03.736450861 -0500 +++ linux/mm/page_alloc.c 2013-03-22 17:07:43.895405617 -0500 @@ -4161,10 +4161,23 @@ int __meminit __early_pfn_to_nid(unsigne { unsigned long start_pfn,

Re: [patch] mm: speedup in __early_pfn_to_nid

2013-03-24 Thread Lin Feng
On 03/24/2013 04:37 AM, Yinghai Lu wrote: +#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP +int __init_memblock memblock_search_pfn_nid(unsigned long pfn, + unsigned long *start_pfn, unsigned long *end_pfn) +{ + struct memblock_type *type = memblock.memory; + int mid =

Re: [patch] mm: speedup in __early_pfn_to_nid

2013-03-23 Thread KOSAKI Motohiro
> --- linux.orig/mm/page_alloc.c 2013-03-19 16:09:03.736450861 -0500 > +++ linux/mm/page_alloc.c 2013-03-22 17:07:43.895405617 -0500 > @@ -4161,10 +4161,23 @@ int __meminit __early_pfn_to_nid(unsigne > { > unsigned long start_pfn, end_pfn; > int i, nid; > + /* > +

Re: [patch] mm: speedup in __early_pfn_to_nid

2013-03-23 Thread Yinghai Lu
On Sat, Mar 23, 2013 at 8:29 AM, Russ Anderson wrote: > On Fri, Mar 22, 2013 at 08:25:32AM +0100, Ingo Molnar wrote: > > When booting on a large memory system, the kernel spends > considerable time in memmap_init_zone() setting up

Re: [patch] mm: speedup in __early_pfn_to_nid

2013-03-23 Thread Russ Anderson
On Fri, Mar 22, 2013 at 08:25:32AM +0100, Ingo Molnar wrote: > > * David Rientjes wrote: > > > On Thu, 21 Mar 2013, Ingo Molnar wrote: > > > > > > Index: linux/mm/page_alloc.c > > > > === > > > > --- linux.orig/mm/page_alloc.c

Re: [patch] mm: speedup in __early_pfn_to_nid

2013-03-23 Thread Russ Anderson
On Fri, Mar 22, 2013 at 08:25:32AM +0100, Ingo Molnar wrote: * David Rientjes rient...@google.com wrote: On Thu, 21 Mar 2013, Ingo Molnar wrote: Index: linux/mm/page_alloc.c === --- linux.orig/mm/page_alloc.c

Re: [patch] mm: speedup in __early_pfn_to_nid

2013-03-23 Thread Yinghai Lu
On Sat, Mar 23, 2013 at 8:29 AM, Russ Anderson r...@sgi.com wrote: On Fri, Mar 22, 2013 at 08:25:32AM +0100, Ingo Molnar wrote: When booting on a large memory system, the kernel spends considerable time in memmap_init_zone() setting

Re: [patch] mm: speedup in __early_pfn_to_nid

2013-03-23 Thread KOSAKI Motohiro
--- linux.orig/mm/page_alloc.c 2013-03-19 16:09:03.736450861 -0500 +++ linux/mm/page_alloc.c 2013-03-22 17:07:43.895405617 -0500 @@ -4161,10 +4161,23 @@ int __meminit __early_pfn_to_nid(unsigne { unsigned long start_pfn, end_pfn; int i, nid; + /* +

Re: [patch] mm: speedup in __early_pfn_to_nid

2013-03-22 Thread Ingo Molnar
* David Rientjes wrote: > On Thu, 21 Mar 2013, Ingo Molnar wrote: > > > > Index: linux/mm/page_alloc.c > > > === > > > --- linux.orig/mm/page_alloc.c2013-03-18 10:52:11.510988843 -0500 > > > +++ linux/mm/page_alloc.c

Re: [patch] mm: speedup in __early_pfn_to_nid

2013-03-22 Thread Ingo Molnar
* David Rientjes rient...@google.com wrote: On Thu, 21 Mar 2013, Ingo Molnar wrote: Index: linux/mm/page_alloc.c === --- linux.orig/mm/page_alloc.c2013-03-18 10:52:11.510988843 -0500 +++ linux/mm/page_alloc.c

Re: [patch] mm: speedup in __early_pfn_to_nid

2013-03-21 Thread David Rientjes
On Thu, 21 Mar 2013, Ingo Molnar wrote: > > Index: linux/mm/page_alloc.c > > === > > --- linux.orig/mm/page_alloc.c 2013-03-18 10:52:11.510988843 -0500 > > +++ linux/mm/page_alloc.c 2013-03-18 10:52:14.214931348 -0500 > > @@

Re: [patch] mm: speedup in __early_pfn_to_nid

2013-03-21 Thread Ingo Molnar
* Michal Hocko wrote: > On Thu 21-03-13 11:55:16, Ingo Molnar wrote: > > > > * Russ Anderson wrote: > > > > > When booting on a large memory system, the kernel spends > > > considerable time in memmap_init_zone() setting up memory zones. > > > Analysis shows significant time spent in

Re: [patch] mm: speedup in __early_pfn_to_nid

2013-03-21 Thread Michal Hocko
On Thu 21-03-13 11:55:16, Ingo Molnar wrote: > > * Russ Anderson wrote: > > > When booting on a large memory system, the kernel spends > > considerable time in memmap_init_zone() setting up memory zones. > > Analysis shows significant time spent in __early_pfn_to_nid(). > > > > The routine

Re: [patch] mm: speedup in __early_pfn_to_nid

2013-03-21 Thread Ingo Molnar
* Russ Anderson wrote: > When booting on a large memory system, the kernel spends > considerable time in memmap_init_zone() setting up memory zones. > Analysis shows significant time spent in __early_pfn_to_nid(). > > The routine memmap_init_zone() checks each PFN to verify the > nid is valid.

Re: [patch] mm: speedup in __early_pfn_to_nid

2013-03-21 Thread Ingo Molnar
* Russ Anderson r...@sgi.com wrote: When booting on a large memory system, the kernel spends considerable time in memmap_init_zone() setting up memory zones. Analysis shows significant time spent in __early_pfn_to_nid(). The routine memmap_init_zone() checks each PFN to verify the nid is

Re: [patch] mm: speedup in __early_pfn_to_nid

2013-03-21 Thread Michal Hocko
On Thu 21-03-13 11:55:16, Ingo Molnar wrote: * Russ Anderson r...@sgi.com wrote: When booting on a large memory system, the kernel spends considerable time in memmap_init_zone() setting up memory zones. Analysis shows significant time spent in __early_pfn_to_nid(). The routine

Re: [patch] mm: speedup in __early_pfn_to_nid

2013-03-21 Thread Ingo Molnar
* Michal Hocko mho...@suse.cz wrote: On Thu 21-03-13 11:55:16, Ingo Molnar wrote: * Russ Anderson r...@sgi.com wrote: When booting on a large memory system, the kernel spends considerable time in memmap_init_zone() setting up memory zones. Analysis shows significant time spent

Re: [patch] mm: speedup in __early_pfn_to_nid

2013-03-21 Thread David Rientjes
On Thu, 21 Mar 2013, Ingo Molnar wrote: Index: linux/mm/page_alloc.c === --- linux.orig/mm/page_alloc.c 2013-03-18 10:52:11.510988843 -0500 +++ linux/mm/page_alloc.c 2013-03-18 10:52:14.214931348 -0500 @@ -4161,10

Re: [patch] mm: speedup in __early_pfn_to_nid

2013-03-20 Thread Andrew Morton
On Mon, 18 Mar 2013 10:56:19 -0500 Russ Anderson wrote: > When booting on a large memory system, the kernel spends > considerable time in memmap_init_zone() setting up memory zones. > Analysis shows significant time spent in __early_pfn_to_nid(). > > The routine memmap_init_zone() checks each

Re: [patch] mm: speedup in __early_pfn_to_nid

2013-03-20 Thread Andrew Morton
On Mon, 18 Mar 2013 10:56:19 -0500 Russ Anderson r...@sgi.com wrote: When booting on a large memory system, the kernel spends considerable time in memmap_init_zone() setting up memory zones. Analysis shows significant time spent in __early_pfn_to_nid(). The routine memmap_init_zone() checks

Re: [patch] mm: speedup in __early_pfn_to_nid

2013-03-18 Thread David Rientjes
On Mon, 18 Mar 2013, Russ Anderson wrote: > When booting on a large memory system, the kernel spends > considerable time in memmap_init_zone() setting up memory zones. > Analysis shows significant time spent in __early_pfn_to_nid(). > > The routine memmap_init_zone() checks each PFN to verify

[patch] mm: speedup in __early_pfn_to_nid

2013-03-18 Thread Russ Anderson
When booting on a large memory system, the kernel spends considerable time in memmap_init_zone() setting up memory zones. Analysis shows significant time spent in __early_pfn_to_nid(). The routine memmap_init_zone() checks each PFN to verify the nid is valid. __early_pfn_to_nid() sequentially

[patch] mm: speedup in __early_pfn_to_nid

2013-03-18 Thread Russ Anderson
When booting on a large memory system, the kernel spends considerable time in memmap_init_zone() setting up memory zones. Analysis shows significant time spent in __early_pfn_to_nid(). The routine memmap_init_zone() checks each PFN to verify the nid is valid. __early_pfn_to_nid() sequentially

Re: [patch] mm: speedup in __early_pfn_to_nid

2013-03-18 Thread David Rientjes
On Mon, 18 Mar 2013, Russ Anderson wrote: When booting on a large memory system, the kernel spends considerable time in memmap_init_zone() setting up memory zones. Analysis shows significant time spent in __early_pfn_to_nid(). The routine memmap_init_zone() checks each PFN to verify the