linux/arch/ia64
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
..
configs [IA64] defconfig: Remove CONFIG_MISC_DEVICES 2012-08-20 13:04:29 -07:00
dig Disintegrate asm/system.h for IA64 2012-03-28 18:30:02 +01:00
hp TTY: cleanup tty->hw_stopped uses 2013-03-18 16:24:30 -07:00
include mm/hugetlb: add more arch-defined huge_pte functions 2013-04-29 15:54:33 -07:00
kernel Bundle of miscellaneous ia64 fixes for 3.10 merge window. 2013-04-29 09:23:17 -07:00
kvm Wrong asm register contraints in the kvm implementation 2013-03-19 16:14:54 -07:00
lib Fix common misspellings 2011-03-31 11:26:23 -03:00
mm mm: speedup in __early_pfn_to_nid 2013-04-29 15:54:35 -07:00
oprofile Disintegrate asm/system.h for IA64 2012-03-28 18:30:02 +01:00
pci ia64/PCI: Implement pcibios_{add|remove}_bus() hooks 2013-04-12 15:38:25 -06:00
scripts scripts: change scripts to use system python instead of env 2010-02-02 14:33:56 +01:00
sn tiocx: check retval from bus_register() 2013-03-19 16:14:52 -07:00
uv ia64: change to new flag variables 2011-03-17 14:02:56 +01:00
xen arch/ia64/xen: remove depends on CONFIG_EXPERIMENTAL 2013-01-11 11:38:04 -08:00
install.sh kbuild: use INSTALLKERNEL to select customized installkernel script 2009-09-20 12:18:14 +02:00
Kconfig Change "select DMAR" to "select INTEL_IOMMU" 2013-03-19 16:14:54 -07:00
Kconfig.debug
Makefile Merge commit 'v2.6.35' into kbuild/kbuild 2010-08-04 13:59:13 +02:00
module.lds