Re: Bootmem broke ARM

From: Andrew Morton
Date: Sun Nov 16 2003 - 15:10:19 EST


Russell King <rmk+lkml@xxxxxxxxxxxxxxxx> wrote:
>
> Andrew & others,
>
> 2.6 contains a change to init_bootmem_core() which now sorts the nodes
> according to their start pfn. This change occurred in revision 1.20 of
> bootmem.c. Unfortunately, this active sorting broke ARM discontig memory
> support.
>
> 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.
>
> However, we now sort the nodes using node_start_pfn, which, at this point,
> will be uninitialised - the responsibility for initialising this field
> is with the generic code - in free_area_init_node() which occurs well
> after bootmem has been initialised.
>
> The result of this change is that we now add nodes to the tail of the
> pgdat list, which is the opposite way to 2.4.
>
> This causes problems for ARM because we need to use bootmem to initialise
> the kernels page tables, and we can only allocate these from node 0 - none
> of the other nodes are mapped into memory at this point.
>
> I, therefore, believe this change is bogus. Can it be reverted please?
>

It looks to be bogus on ia64 as well, for which the patch was written.

Or maybe ia64 _does_ arrange for the node_start_pfn to be initialised
before init_bootmem_core(), but I cannot see where. So the attempt to sort
the pgdat list in there doesn't actually sort it at all - it simply
reverses it by accident.

Jesse, it looks like this needs to be revisited please.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/