Commit 5d3d0f77 authored by Andi Kleen's avatar Andi Kleen Committed by Linus Torvalds

[PATCH] x86-64: Reverse order of bootmem lists

This leads to bootmem allocating first from node 0 instead
of from the last node.  This avoids swiotlb allocating on the last node, which
doesn't really work on a machine with >4GB.

Note: there is a better patch around from someone else that gets
rid of the pgdat list completely.
Signed-off-by: default avatarAndi Kleen <ak@suse.de>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 6142891a
...@@ -61,9 +61,17 @@ static unsigned long __init init_bootmem_core (pg_data_t *pgdat, ...@@ -61,9 +61,17 @@ static unsigned long __init init_bootmem_core (pg_data_t *pgdat,
{ {
bootmem_data_t *bdata = pgdat->bdata; bootmem_data_t *bdata = pgdat->bdata;
unsigned long mapsize = ((end - start)+7)/8; unsigned long mapsize = ((end - start)+7)/8;
static struct pglist_data *pgdat_last;
pgdat->pgdat_next = pgdat_list;
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_list = pgdat;
pgdat_last = pgdat;
}
mapsize = ALIGN(mapsize, sizeof(long)); mapsize = ALIGN(mapsize, sizeof(long));
bdata->node_bootmem_map = phys_to_virt(mapstart << PAGE_SHIFT); bdata->node_bootmem_map = phys_to_virt(mapstart << PAGE_SHIFT);
......
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