aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/mm
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/ia64/mm
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/ia64/mm')
-rw-r--r--arch/ia64/mm/discontig.c19
1 files changed, 10 insertions, 9 deletions
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