aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJohannes Weiner <hannes@saeurebad.de>2008-07-24 00:28:09 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-24 13:47:20 -0400
commit3560e249abda6bee41a07a7bf0383a6e193e2839 (patch)
treea5770b74f13dca64e34cd5a1e3182e4e1f98a9ca /arch
parent75a56cfe9fdb064d1db1cfbc564315fddb756fb1 (diff)
bootmem: replace node_boot_start in struct bootmem_data
Almost all users of this field need a PFN instead of a physical address, so replace node_boot_start with node_min_pfn. [Lee.Schermerhorn@hp.com: fix spurious BUG_ON() in mark_bootmem()] Signed-off-by: Johannes Weiner <hannes@saeureba.de> Cc: <linux-arch@vger.kernel.org> Signed-off-by: Lee Schermerhorn <lee.schermerhorn@hp.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/mm/numa.c2
-rw-r--r--arch/arm/plat-omap/fb.c4
-rw-r--r--arch/avr32/mm/init.c3
-rw-r--r--arch/ia64/mm/discontig.c19
-rw-r--r--arch/m32r/mm/discontig.c3
-rw-r--r--arch/m32r/mm/init.c4
-rw-r--r--arch/mn10300/mm/init.c6
-rw-r--r--arch/sh/mm/init.c2
8 files changed, 19 insertions, 24 deletions
diff --git a/arch/alpha/mm/numa.c b/arch/alpha/mm/numa.c
index def0c74a78a8..d8c4ceaf00b9 100644
--- a/arch/alpha/mm/numa.c
+++ b/arch/alpha/mm/numa.c
@@ -304,7 +304,7 @@ void __init paging_init(void)
304 304
305 for_each_online_node(nid) { 305 for_each_online_node(nid) {
306 bootmem_data_t *bdata = &bootmem_node_data[nid]; 306 bootmem_data_t *bdata = &bootmem_node_data[nid];
307 unsigned long start_pfn = bdata->node_boot_start >> PAGE_SHIFT; 307 unsigned long start_pfn = bdata->node_min_pfn;
308 unsigned long end_pfn = bdata->node_low_pfn; 308 unsigned long end_pfn = bdata->node_low_pfn;
309 309
310 if (dma_local_pfn >= end_pfn - start_pfn) 310 if (dma_local_pfn >= end_pfn - start_pfn)
diff --git a/arch/arm/plat-omap/fb.c b/arch/arm/plat-omap/fb.c
index 7854f19b77cf..96d6f0619733 100644
--- a/arch/arm/plat-omap/fb.c
+++ b/arch/arm/plat-omap/fb.c
@@ -182,7 +182,7 @@ void __init omapfb_reserve_sdram(void)
182 return; 182 return;
183 183
184 bdata = NODE_DATA(0)->bdata; 184 bdata = NODE_DATA(0)->bdata;
185 sdram_start = bdata->node_boot_start; 185 sdram_start = bdata->node_min_pfn << PAGE_SHIFT;
186 sdram_size = (bdata->node_low_pfn << PAGE_SHIFT) - sdram_start; 186 sdram_size = (bdata->node_low_pfn << PAGE_SHIFT) - sdram_start;
187 reserved = 0; 187 reserved = 0;
188 for (i = 0; ; i++) { 188 for (i = 0; ; i++) {
@@ -340,5 +340,3 @@ unsigned long omapfb_reserve_sram(unsigned long sram_pstart,
340 340
341 341
342#endif 342#endif
343
344
diff --git a/arch/avr32/mm/init.c b/arch/avr32/mm/init.c
index 786de88a82a7..3c85fdaa9487 100644
--- a/arch/avr32/mm/init.c
+++ b/arch/avr32/mm/init.c
@@ -119,8 +119,7 @@ void __init paging_init(void)
119 unsigned long zones_size[MAX_NR_ZONES]; 119 unsigned long zones_size[MAX_NR_ZONES];
120 unsigned long low, start_pfn; 120 unsigned long low, start_pfn;
121 121
122 start_pfn = pgdat->bdata->node_boot_start; 122 start_pfn = pgdat->bdata->node_min_pfn;
123 start_pfn >>= PAGE_SHIFT;
124 low = pgdat->bdata->node_low_pfn; 123 low = pgdat->bdata->node_low_pfn;
125 124
126 memset(zones_size, 0, sizeof(zones_size)); 125 memset(zones_size, 0, sizeof(zones_size));
diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c
index 2fcf8464331e..d83125e1ed27 100644
--- a/arch/ia64/mm/discontig.c
+++ b/arch/ia64/mm/discontig.c
@@ -74,17 +74,17 @@ pg_data_t *pgdat_list[MAX_NUMNODES];
74static int __init build_node_maps(unsigned long start, unsigned long len, 74static int __init build_node_maps(unsigned long start, unsigned long len,
75 int node) 75 int node)
76{ 76{
77 unsigned long cstart, epfn, end = start + len; 77 unsigned long spfn, epfn, end = start + len;
78 struct bootmem_data *bdp = &bootmem_node_data[node]; 78 struct bootmem_data *bdp = &bootmem_node_data[node];
79 79
80 epfn = GRANULEROUNDUP(end) >> PAGE_SHIFT; 80 epfn = GRANULEROUNDUP(end) >> PAGE_SHIFT;
81 cstart = GRANULEROUNDDOWN(start); 81 spfn = GRANULEROUNDDOWN(start) >> PAGE_SHIFT;
82 82
83 if (!bdp->node_low_pfn) { 83 if (!bdp->node_low_pfn) {
84 bdp->node_boot_start = cstart; 84 bdp->node_min_pfn = spfn;
85 bdp->node_low_pfn = epfn; 85 bdp->node_low_pfn = epfn;
86 } else { 86 } else {
87 bdp->node_boot_start = min(cstart, bdp->node_boot_start); 87 bdp->node_min_pfn = min(spfn, bdp->node_min_pfn);
88 bdp->node_low_pfn = max(epfn, bdp->node_low_pfn); 88 bdp->node_low_pfn = max(epfn, bdp->node_low_pfn);
89 } 89 }
90 90
@@ -221,20 +221,21 @@ static void __init fill_pernode(int node, unsigned long pernode,
221static int __init find_pernode_space(unsigned long start, unsigned long len, 221static int __init find_pernode_space(unsigned long start, unsigned long len,
222 int node) 222 int node)
223{ 223{
224 unsigned long epfn; 224 unsigned long spfn, epfn;
225 unsigned long pernodesize = 0, pernode, pages, mapsize; 225 unsigned long pernodesize = 0, pernode, pages, mapsize;
226 struct bootmem_data *bdp = &bootmem_node_data[node]; 226 struct bootmem_data *bdp = &bootmem_node_data[node];
227 227
228 spfn = start >> PAGE_SHIFT;
228 epfn = (start + len) >> PAGE_SHIFT; 229 epfn = (start + len) >> PAGE_SHIFT;
229 230
230 pages = bdp->node_low_pfn - (bdp->node_boot_start >> PAGE_SHIFT); 231 pages = bdp->node_low_pfn - bdp->node_min_pfn;
231 mapsize = bootmem_bootmap_pages(pages) << PAGE_SHIFT; 232 mapsize = bootmem_bootmap_pages(pages) << PAGE_SHIFT;
232 233
233 /* 234 /*
234 * Make sure this memory falls within this node's usable memory 235 * Make sure this memory falls within this node's usable memory
235 * since we may have thrown some away in build_maps(). 236 * since we may have thrown some away in build_maps().
236 */ 237 */
237 if (start < bdp->node_boot_start || epfn > bdp->node_low_pfn) 238 if (spfn < bdp->node_min_pfn || epfn > bdp->node_low_pfn)
238 return 0; 239 return 0;
239 240
240 /* Don't setup this node's local space twice... */ 241 /* Don't setup this node's local space twice... */
@@ -296,7 +297,7 @@ static void __init reserve_pernode_space(void)
296 bdp = pdp->bdata; 297 bdp = pdp->bdata;
297 298
298 /* First the bootmem_map itself */ 299 /* First the bootmem_map itself */
299 pages = bdp->node_low_pfn - (bdp->node_boot_start>>PAGE_SHIFT); 300 pages = bdp->node_low_pfn - bdp->node_min_pfn;
300 size = bootmem_bootmap_pages(pages) << PAGE_SHIFT; 301 size = bootmem_bootmap_pages(pages) << PAGE_SHIFT;
301 base = __pa(bdp->node_bootmem_map); 302 base = __pa(bdp->node_bootmem_map);
302 reserve_bootmem_node(pdp, base, size, BOOTMEM_DEFAULT); 303 reserve_bootmem_node(pdp, base, size, BOOTMEM_DEFAULT);
@@ -466,7 +467,7 @@ void __init find_memory(void)
466 467
467 init_bootmem_node(pgdat_list[node], 468 init_bootmem_node(pgdat_list[node],
468 map>>PAGE_SHIFT, 469 map>>PAGE_SHIFT,
469 bdp->node_boot_start>>PAGE_SHIFT, 470 bdp->node_min_pfn,
470 bdp->node_low_pfn); 471 bdp->node_low_pfn);
471 } 472 }
472 473
diff --git a/arch/m32r/mm/discontig.c b/arch/m32r/mm/discontig.c
index cc23934bc41e..cbc3c4c54566 100644
--- a/arch/m32r/mm/discontig.c
+++ b/arch/m32r/mm/discontig.c
@@ -123,8 +123,7 @@ unsigned long __init setup_memory(void)
123 return max_low_pfn; 123 return max_low_pfn;
124} 124}
125 125
126#define START_PFN(nid) \ 126#define START_PFN(nid) (NODE_DATA(nid)->bdata->node_min_pfn)
127 (NODE_DATA(nid)->bdata->node_boot_start >> PAGE_SHIFT)
128#define MAX_LOW_PFN(nid) (NODE_DATA(nid)->bdata->node_low_pfn) 127#define MAX_LOW_PFN(nid) (NODE_DATA(nid)->bdata->node_low_pfn)
129 128
130unsigned long __init zone_sizes_init(void) 129unsigned long __init zone_sizes_init(void)
diff --git a/arch/m32r/mm/init.c b/arch/m32r/mm/init.c
index 28799af15e95..2554eb59cfef 100644
--- a/arch/m32r/mm/init.c
+++ b/arch/m32r/mm/init.c
@@ -93,8 +93,7 @@ void free_initrd_mem(unsigned long, unsigned long);
93#endif 93#endif
94 94
95/* It'd be good if these lines were in the standard header file. */ 95/* It'd be good if these lines were in the standard header file. */
96#define START_PFN(nid) \ 96#define START_PFN(nid) (NODE_DATA(nid)->bdata->node_min_pfn)
97 (NODE_DATA(nid)->bdata->node_boot_start >> PAGE_SHIFT)
98#define MAX_LOW_PFN(nid) (NODE_DATA(nid)->bdata->node_low_pfn) 97#define MAX_LOW_PFN(nid) (NODE_DATA(nid)->bdata->node_low_pfn)
99 98
100#ifndef CONFIG_DISCONTIGMEM 99#ifndef CONFIG_DISCONTIGMEM
@@ -252,4 +251,3 @@ void free_initrd_mem(unsigned long start, unsigned long end)
252 printk (KERN_INFO "Freeing initrd memory: %ldk freed\n", (end - start) >> 10); 251 printk (KERN_INFO "Freeing initrd memory: %ldk freed\n", (end - start) >> 10);
253} 252}
254#endif 253#endif
255
diff --git a/arch/mn10300/mm/init.c b/arch/mn10300/mm/init.c
index 8c5d88c7b90a..8cee387a24fd 100644
--- a/arch/mn10300/mm/init.c
+++ b/arch/mn10300/mm/init.c
@@ -67,8 +67,8 @@ void __init paging_init(void)
67 67
68 /* declare the sizes of the RAM zones (only use the normal zone) */ 68 /* declare the sizes of the RAM zones (only use the normal zone) */
69 zones_size[ZONE_NORMAL] = 69 zones_size[ZONE_NORMAL] =
70 (contig_page_data.bdata->node_low_pfn) - 70 contig_page_data.bdata->node_low_pfn -
71 (contig_page_data.bdata->node_boot_start >> PAGE_SHIFT); 71 contig_page_data.bdata->node_min_pfn;
72 72
73 /* pass the memory from the bootmem allocator to the main allocator */ 73 /* pass the memory from the bootmem allocator to the main allocator */
74 free_area_init(zones_size); 74 free_area_init(zones_size);
@@ -87,7 +87,7 @@ void __init mem_init(void)
87 if (!mem_map) 87 if (!mem_map)
88 BUG(); 88 BUG();
89 89
90#define START_PFN (contig_page_data.bdata->node_boot_start >> PAGE_SHIFT) 90#define START_PFN (contig_page_data.bdata->node_min_pfn)
91#define MAX_LOW_PFN (contig_page_data.bdata->node_low_pfn) 91#define MAX_LOW_PFN (contig_page_data.bdata->node_low_pfn)
92 92
93 max_mapnr = num_physpages = MAX_LOW_PFN - START_PFN; 93 max_mapnr = num_physpages = MAX_LOW_PFN - START_PFN;
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c
index d7df26bd1e54..d652d375eb1e 100644
--- a/arch/sh/mm/init.c
+++ b/arch/sh/mm/init.c
@@ -191,7 +191,7 @@ void __init paging_init(void)
191 pg_data_t *pgdat = NODE_DATA(nid); 191 pg_data_t *pgdat = NODE_DATA(nid);
192 unsigned long low, start_pfn; 192 unsigned long low, start_pfn;
193 193
194 start_pfn = pgdat->bdata->node_boot_start >> PAGE_SHIFT; 194 start_pfn = pgdat->bdata->node_min_pfn;
195 low = pgdat->bdata->node_low_pfn; 195 low = pgdat->bdata->node_low_pfn;
196 196
197 if (max_zone_pfns[ZONE_NORMAL] < low) 197 if (max_zone_pfns[ZONE_NORMAL] < low)