Commit 767aa962 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] fix free_all_bootmem_core for virtual memmap

From: jbarnes@sgi.com (Jesse Barnes)

Currently, free_all_bootmem_core() assumes that the bdata for a given
node will begin where the node's memory map begins.  This isn't
necessarily true on machines that use a virtual memory map (e.g. ia64
discontig machines), so we fix page to point to the first actual page of
RAM on the node, which _does_ contain the bdata struct.
parent d3d147ac
...@@ -267,7 +267,7 @@ __alloc_bootmem_core(struct bootmem_data *bdata, unsigned long size, ...@@ -267,7 +267,7 @@ __alloc_bootmem_core(struct bootmem_data *bdata, unsigned long size,
static unsigned long __init free_all_bootmem_core(pg_data_t *pgdat) static unsigned long __init free_all_bootmem_core(pg_data_t *pgdat)
{ {
struct page *page = pgdat->node_mem_map; struct page *page;
bootmem_data_t *bdata = pgdat->bdata; bootmem_data_t *bdata = pgdat->bdata;
unsigned long i, count, total = 0; unsigned long i, count, total = 0;
unsigned long idx; unsigned long idx;
...@@ -276,6 +276,8 @@ static unsigned long __init free_all_bootmem_core(pg_data_t *pgdat) ...@@ -276,6 +276,8 @@ static unsigned long __init free_all_bootmem_core(pg_data_t *pgdat)
if (!bdata->node_bootmem_map) BUG(); if (!bdata->node_bootmem_map) BUG();
count = 0; count = 0;
/* first extant page of the node */
page = virt_to_page(phys_to_virt(bdata->node_boot_start));
idx = bdata->node_low_pfn - (bdata->node_boot_start >> PAGE_SHIFT); idx = bdata->node_low_pfn - (bdata->node_boot_start >> PAGE_SHIFT);
map = bdata->node_bootmem_map; map = bdata->node_bootmem_map;
for (i = 0; i < idx; ) { for (i = 0; i < idx; ) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment