linux/arch/ia64/mm
Russ Anderson 7c243c7168 mm: speedup in __early_pfn_to_nid
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 scans the list of pfn ranges
to find the right range and returns the nid.  This does not scale well.
On a 4 TB (single rack) system there are 308 memory ranges to scan.  The
higher the PFN the more time spent sequentially spinning through memory
ranges.

Since memmap_init_zone() increments pfn, it will almost always be
looking for the same range as the previous pfn, so check that range
first.  If it is in the same range, return that nid.  If not, scan the
list as before.

A 4 TB (single rack) UV1 system takes 512 seconds to get through the
zone code.  This performance optimization reduces the time by 189
seconds, a 36% improvement.

A 2 TB (single rack) UV2 system goes from 212.7 seconds to 99.8 seconds,
a 112.9 second (53%) reduction.

[akpm@linux-foundation.org: make the statics __meminitdata]
[akpm@linux-foundation.org: fix comment formatting]
[akpm@linux-foundation.org: fix ia64, per yinghai]
[akpm@linux-foundation.org: add missing semicolon, per Tony]
Signed-off-by: Russ Anderson <rja@sgi.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Tested-by: "Luck, Tony" <tony.luck@intel.com>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Lin Feng <linfeng@cn.fujitsu.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-04-29 15:54:35 -07:00
..
contig.c mm, show_mem: suppress page counts in non-blockable contexts 2013-04-29 15:54:28 -07:00
discontig.c sparse-vmemmap: specify vmemmap population range in bytes 2013-04-29 15:54:35 -07:00
extable.c [IA64] fix compile error in arch/ia64/mm/extable.c 2009-06-15 09:17:50 -07:00
fault.c readahead: fault retry breaks mmap file read random detection 2012-10-09 16:22:47 +09:00
hugetlbpage.c mm: use vm_unmapped_area() in hugetlbfs on ia64 architecture 2013-02-22 13:48:24 -08:00
init.c mm/IA64: use common help functions to free reserved pages 2013-04-29 15:54:30 -07:00
ioremap.c Add WB/UC check for early_ioremap 2013-03-19 16:14:52 -07:00
Makefile [PATCH] ia64: ioremap: check EFI for valid memory attributes 2006-03-26 08:56:54 -08:00
numa.c mm: speedup in __early_pfn_to_nid 2013-04-29 15:54:35 -07:00
tlb.c IA64: drivers: remove __dev* attributes. 2013-01-03 15:57:13 -08:00