Commit c555e520 authored by Dave Hansen's avatar Dave Hansen Committed by Benjamin Herrenschmidt

powerpc/mm: Add better comment on careful_allocation()

The behavior in careful_allocation() really confused me
at first.  Add a comment to hopefully make it easier
on the next doofus that looks at it.
Signed-off-by: default avatarDave Hansen <dave@linux.vnet.ibm.com>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent afcb0654
...@@ -840,8 +840,16 @@ static void __init *careful_allocation(int nid, unsigned long size, ...@@ -840,8 +840,16 @@ static void __init *careful_allocation(int nid, unsigned long size,
size, nid); size, nid);
/* /*
* If the memory came from a previously allocated node, we must * We initialize the nodes in numeric order: 0, 1, 2...
* retry with the bootmem allocator. * and hand over control from the LMB allocator to the
* bootmem allocator. If this function is called for
* node 5, then we know that all nodes <5 are using the
* bootmem allocator instead of the LMB allocator.
*
* So, check the nid from which this allocation came
* and double check to see if we need to use bootmem
* instead of the LMB. We don't free the LMB memory
* since it would be useless.
*/ */
new_nid = early_pfn_to_nid(ret >> PAGE_SHIFT); new_nid = early_pfn_to_nid(ret >> PAGE_SHIFT);
if (new_nid < nid) { if (new_nid < nid) {
......
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