aboutsummaryrefslogtreecommitdiff
path: root/mm/bootmem.c
diff options
context:
space:
mode:
authorGreg KH <gregkh@suse.de>2005-09-12 12:45:04 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2005-09-12 12:45:04 -0700
commitd58dde0f552a5c5c4485b962d8b6e9dd54fefb30 (patch)
treed9a7e35eb88fea6265d5aadcc3d4ed39122b052a /mm/bootmem.c
parent877599fdef5ea4a7dd1956e22fa9d6923add97f8 (diff)
parent2ade81473636b33aaac64495f89a7dc572c529f0 (diff)
Merge ../torvalds-2.6/
Diffstat (limited to 'mm/bootmem.c')
-rw-r--r--mm/bootmem.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/mm/bootmem.c b/mm/bootmem.c
index c1330cc1978..8ec4e4c2a17 100644
--- a/mm/bootmem.c
+++ b/mm/bootmem.c
@@ -61,9 +61,17 @@ static unsigned long __init init_bootmem_core (pg_data_t *pgdat,
{
bootmem_data_t *bdata = pgdat->bdata;
unsigned long mapsize = ((end - start)+7)/8;
-
- pgdat->pgdat_next = pgdat_list;
- pgdat_list = pgdat;
+ static struct pglist_data *pgdat_last;
+
+ pgdat->pgdat_next = NULL;
+ /* Add new nodes last so that bootmem always starts
+ searching in the first nodes, not the last ones */
+ if (pgdat_last)
+ pgdat_last->pgdat_next = pgdat;
+ else {
+ pgdat_list = pgdat;
+ pgdat_last = pgdat;
+ }
mapsize = ALIGN(mapsize, sizeof(long));
bdata->node_bootmem_map = phys_to_virt(mapstart << PAGE_SHIFT);