From f2b4a98eec37cc56a1f4281288181f170b2bab76 Mon Sep 17 00:00:00 2001 From: Jesse Barnes Date: Sun, 16 Nov 2003 18:10:13 -0800 Subject: [PATCH] [PATCH] Fix bootmem breakage on ARM Russell King reports: "With previous kernels, the nodes are added to the list in reverse order, so architecture code knew we had to add the highest PFN first and the lowest PFN node last. Unfortunately, init_bootmem_core() now sorts the nodes according to their start pfn. This active sorting broke ARM discontig memory support." Andrew Morton chimes in: "It looks to be bogus on ia64 as well, for which the patch was written" Yep, I think it is bogus. There's only one caller on ia64 that would be affected--swiotlb_init(), and afaik multi-node systems won't be using that code (except maybe NEC?), so even if the pgdat list is out of order we should be ok. If not I'll fix the ia64 discontig code. --- mm/bootmem.c | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/mm/bootmem.c b/mm/bootmem.c index 1d5c1de81fbad..ec2862a9244b8 100644 --- a/mm/bootmem.c +++ b/mm/bootmem.c @@ -48,24 +48,8 @@ static unsigned long __init init_bootmem_core (pg_data_t *pgdat, bootmem_data_t *bdata = pgdat->bdata; unsigned long mapsize = ((end - start)+7)/8; - - /* - * sort pgdat_list so that the lowest one comes first, - * which makes alloc_bootmem_low_pages work as desired. - */ - if (!pgdat_list || pgdat_list->node_start_pfn > pgdat->node_start_pfn) { - pgdat->pgdat_next = pgdat_list; - pgdat_list = pgdat; - } else { - pg_data_t *tmp = pgdat_list; - while (tmp->pgdat_next) { - if (tmp->pgdat_next->node_start_pfn > pgdat->node_start_pfn) - break; - tmp = tmp->pgdat_next; - } - pgdat->pgdat_next = tmp->pgdat_next; - tmp->pgdat_next = pgdat; - } + pgdat->pgdat_next = pgdat_list; + pgdat_list = pgdat; mapsize = (mapsize + (sizeof(long) - 1UL)) & ~(sizeof(long) - 1UL); bdata->node_bootmem_map = phys_to_virt(mapstart << PAGE_SHIFT); -- 2.53.0