android_kernel_samsung_msm8976/include
Andy Whitcroft 641c767389 [PATCH] sparsemem swiss cheese numa layouts
The part of the sparsemem patch which modifies memmap_init_zone() has recently
become a problem.  It changes behavior so that there is a call to
pfn_to_page() for each individual page inside of a node's range:
node_start_pfn through node_end_pfn.  It used to simply do this once, at the
beginning of the node, but having sparsemem's non-contiguous mem_map[]s inside
of a node made it necessary to change.

Mike Kravetz recently wrote a patch which made the NUMA code accept some new
kinds of layouts.  The system's memory was laid out like this, with node 0's
memory in two pieces: one before and one after node 1's memory:

	Node 0: +++++     +++++
	Node 1:      +++++

Previous behavior before Mike's patch was to assign nodes like this:

	Node 0: 00000     XXXXX
	Node 1:      11111

Where the 'X' areas were simply thrown away.  The new behavior was to make the
pg_data_t span node 0 across all of its areas, including areas that are really
node 1's: Node 0: 000000000000000 Node 1: 11111

This wastes a little bit of mem_map space, but ends up being OK, and more
fully utilizes the system's memory.  memmap_init_zone() initializes all of the
"struct page"s for node 0, even for the "hole", but those never get used,
because there is no pfn_to_page() that resolves to those pages.  However, only
calling pfn_to_page() once, memmap_init_zone() always uses the pages that were
allocated for node0->node_mem_map because:

	struct page *start = pfn_to_page(start_pfn);
	// effectively start = &node->node_mem_map[0]
	for (page = start; page < (start + size); page++) {
		init_page_here();...
		page++;
	}

Slow, and wasteful, but generally harmless.

But, modify that to call pfn_to_page() for each loop iteration (like sparsemem
does):

	for (pfn = start_pfn; pfn < < (start_pfn + size); pfn++++) {
		page = pfn_to_page(pfn);
	}

And you end up trying to initialize node 1's pages too early, along with bogus
data from node 0.  This patch checks for those weird layouts and declines to
touch the pages, making the more frequent pfn_to_page() calls OK to do.

Signed-off-by: Dave Hansen <haveblue@us.ibm.com>
Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-23 09:45:05 -07:00
..
acpi
asm-alpha [PATCH] remove non-DISCONTIG use of pgdat->node_mem_map 2005-06-23 09:45:00 -07:00
asm-arm Merge master.kernel.org:/home/rmk/linux-2.6-arm 2005-06-22 14:51:06 -07:00
asm-arm26 [PATCH] Remove obsolete HAVE_ARCH_GET_SIGNAL_TO_DELIVER? 2005-06-12 20:43:21 -07:00
asm-cris
asm-frv
asm-generic [PATCH] msync: check pte dirty earlier 2005-06-21 18:46:21 -07:00
asm-h8300 [PATCH] h8300 build error fix 2005-06-06 14:42:23 -07:00
asm-i386 [PATCH] sparsemem memory model for i386 2005-06-23 09:45:05 -07:00
asm-ia64 [PATCH] ia64: pfn_to_nid() implementation 2005-06-21 18:46:19 -07:00
asm-m32r [PATCH] remove non-DISCONTIG use of pgdat->node_mem_map 2005-06-23 09:45:00 -07:00
asm-m68k
asm-m68knommu
asm-mips [PATCH] mips: add vr41xx gpio support 2005-06-21 18:46:32 -07:00
asm-parisc [PATCH] remove non-DISCONTIG use of pgdat->node_mem_map 2005-06-23 09:45:00 -07:00
asm-ppc [PATCH] ppc32: Clean up NUM_TLBCAMS usage for Freescale Book-E PPC's 2005-06-21 18:46:24 -07:00
asm-ppc64 [PATCH] remove non-DISCONTIG use of pgdat->node_mem_map 2005-06-23 09:45:00 -07:00
asm-s390 [PATCH] smp_processor_id() cleanup 2005-06-21 18:46:13 -07:00
asm-sh [PATCH] Hugepage consolidation 2005-06-21 18:46:15 -07:00
asm-sh64 [PATCH] Hugepage consolidation 2005-06-21 18:46:15 -07:00
asm-sparc [PATCH] smp_processor_id() cleanup 2005-06-21 18:46:13 -07:00
asm-sparc64 [PATCH] Hugepage consolidation 2005-06-21 18:46:15 -07:00
asm-um [PATCH] smp_processor_id() cleanup 2005-06-21 18:46:13 -07:00
asm-v850
asm-x86_64 [PATCH] remove non-DISCONTIG use of pgdat->node_mem_map 2005-06-23 09:45:00 -07:00
linux [PATCH] sparsemem swiss cheese numa layouts 2005-06-23 09:45:05 -07:00
math-emu
media
mtd
net [X25]: Fast select with no restriction on response 2005-06-22 22:16:17 -07:00
pcmcia
rxrpc
scsi Automatic merge of ../scsi-misc-2.6-old/ 2005-05-26 14:14:55 -04:00
sound [ALSA] Add const prefix 2005-06-22 12:28:54 +02:00
video