diff options
author | Andy Whitcroft <apw@shadowen.org> | 2005-06-23 03:07:57 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-23 12:45:05 -0400 |
commit | 05b79bdcb48c18cd9b580c39e3efb9a1ab078151 (patch) | |
tree | 1767aaa7a4621ff4cf1a85c2078229de54272f30 /arch/i386/mm/discontig.c | |
parent | d41dee369bff3b9dcb6328d4d822926c28cc2594 (diff) |
[PATCH] sparsemem memory model for i386
Provide the architecture specific implementation for SPARSEMEM for i386 SMP
and NUMA systems.
Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Dave Hansen <haveblue@us.ibm.com>
Signed-off-by: Martin Bligh <mbligh@aracnet.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/i386/mm/discontig.c')
-rw-r--r-- | arch/i386/mm/discontig.c | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/arch/i386/mm/discontig.c b/arch/i386/mm/discontig.c index 088ca4722183..0efeb96ba5d4 100644 --- a/arch/i386/mm/discontig.c +++ b/arch/i386/mm/discontig.c | |||
@@ -42,12 +42,16 @@ bootmem_data_t node0_bdata; | |||
42 | * populated the following initialisation. | 42 | * populated the following initialisation. |
43 | * | 43 | * |
44 | * 1) node_online_map - the map of all nodes configured (online) in the system | 44 | * 1) node_online_map - the map of all nodes configured (online) in the system |
45 | * 2) physnode_map - the mapping between a pfn and owning node | 45 | * 2) node_start_pfn - the starting page frame number for a node |
46 | * 3) node_start_pfn - the starting page frame number for a node | ||
47 | * 3) node_end_pfn - the ending page fram number for a node | 46 | * 3) node_end_pfn - the ending page fram number for a node |
48 | */ | 47 | */ |
48 | unsigned long node_start_pfn[MAX_NUMNODES]; | ||
49 | unsigned long node_end_pfn[MAX_NUMNODES]; | ||
50 | |||
49 | 51 | ||
52 | #ifdef CONFIG_DISCONTIGMEM | ||
50 | /* | 53 | /* |
54 | * 4) physnode_map - the mapping between a pfn and owning node | ||
51 | * physnode_map keeps track of the physical memory layout of a generic | 55 | * physnode_map keeps track of the physical memory layout of a generic |
52 | * numa node on a 256Mb break (each element of the array will | 56 | * numa node on a 256Mb break (each element of the array will |
53 | * represent 256Mb of memory and will be marked by the node id. so, | 57 | * represent 256Mb of memory and will be marked by the node id. so, |
@@ -85,9 +89,7 @@ unsigned long node_memmap_size_bytes(int nid, unsigned long start_pfn, | |||
85 | 89 | ||
86 | return (nr_pages + 1) * sizeof(struct page); | 90 | return (nr_pages + 1) * sizeof(struct page); |
87 | } | 91 | } |
88 | 92 | #endif | |
89 | unsigned long node_start_pfn[MAX_NUMNODES]; | ||
90 | unsigned long node_end_pfn[MAX_NUMNODES]; | ||
91 | 93 | ||
92 | extern unsigned long find_max_low_pfn(void); | 94 | extern unsigned long find_max_low_pfn(void); |
93 | extern void find_max_pfn(void); | 95 | extern void find_max_pfn(void); |
@@ -390,24 +392,26 @@ void __init set_highmem_pages_init(int bad_ppro) | |||
390 | { | 392 | { |
391 | #ifdef CONFIG_HIGHMEM | 393 | #ifdef CONFIG_HIGHMEM |
392 | struct zone *zone; | 394 | struct zone *zone; |
395 | struct page *page; | ||
393 | 396 | ||
394 | for_each_zone(zone) { | 397 | for_each_zone(zone) { |
395 | unsigned long node_pfn, node_high_size, zone_start_pfn; | 398 | unsigned long node_pfn, zone_start_pfn, zone_end_pfn; |
396 | struct page * zone_mem_map; | 399 | |
397 | |||
398 | if (!is_highmem(zone)) | 400 | if (!is_highmem(zone)) |
399 | continue; | 401 | continue; |
400 | 402 | ||
401 | printk("Initializing %s for node %d\n", zone->name, | ||
402 | zone->zone_pgdat->node_id); | ||
403 | |||
404 | node_high_size = zone->spanned_pages; | ||
405 | zone_mem_map = zone->zone_mem_map; | ||
406 | zone_start_pfn = zone->zone_start_pfn; | 403 | zone_start_pfn = zone->zone_start_pfn; |
404 | zone_end_pfn = zone_start_pfn + zone->spanned_pages; | ||
405 | |||
406 | printk("Initializing %s for node %d (%08lx:%08lx)\n", | ||
407 | zone->name, zone->zone_pgdat->node_id, | ||
408 | zone_start_pfn, zone_end_pfn); | ||
407 | 409 | ||
408 | for (node_pfn = 0; node_pfn < node_high_size; node_pfn++) { | 410 | for (node_pfn = zone_start_pfn; node_pfn < zone_end_pfn; node_pfn++) { |
409 | one_highpage_init((struct page *)(zone_mem_map + node_pfn), | 411 | if (!pfn_valid(node_pfn)) |
410 | zone_start_pfn + node_pfn, bad_ppro); | 412 | continue; |
413 | page = pfn_to_page(node_pfn); | ||
414 | one_highpage_init(page, node_pfn, bad_ppro); | ||
411 | } | 415 | } |
412 | } | 416 | } |
413 | totalram_pages += totalhigh_pages; | 417 | totalram_pages += totalhigh_pages; |