All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Hansen <dave@linux.vnet.ibm.com>
To: paulus@samba.org
Cc: Jon Tollefson <kniht@linux.vnet.ibm.com>,
	Mel Gorman <mel@csn.ul.ie>, Dave Hansen <dave@linux.vnet.ibm.com>,
	linuxppc-dev@ozlabs.org, "Serge E. Hallyn" <serue@us.ibm.com>
Subject: [PATCH 2/8] Add better comment on careful_allocation()
Date: Tue, 09 Dec 2008 10:21:32 -0800	[thread overview]
Message-ID: <20081209182132.9C2A37FD@kernel> (raw)
In-Reply-To: <20081209182130.DB2150A2@kernel>


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: Dave Hansen <dave@linux.vnet.ibm.com>
---

 linux-2.6.git-dave/arch/powerpc/mm/numa.c |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff -puN arch/powerpc/mm/numa.c~cleanup-careful_allocation4 arch/powerpc/mm/numa.c
--- linux-2.6.git/arch/powerpc/mm/numa.c~cleanup-careful_allocation4	2008-12-09 10:16:05.000000000 -0800
+++ linux-2.6.git-dave/arch/powerpc/mm/numa.c	2008-12-09 10:16:05.000000000 -0800
@@ -840,8 +840,16 @@ static void __init *careful_allocation(i
 		      size, nid);
 
 	/*
-	 * If the memory came from a previously allocated node, we must
-	 * retry with the bootmem allocator.
+	 * We initialize the nodes in numeric order: 0, 1, 2...
+	 * 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);
 	if (new_nid < nid) {
_

  parent reply	other threads:[~2008-12-09 18:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-09 18:21 [PATCH 0/8] Fix a bug and cleanup NUMA boot-time code Dave Hansen
2008-12-09 18:21 ` [PATCH 1/8] fix bootmem reservation on uninitialized node Dave Hansen
2008-12-10 22:14   ` Paul Mackerras
2008-12-10 22:30     ` Jon Tollefson
2008-12-10 22:54     ` Dave Hansen
2008-12-09 18:21 ` Dave Hansen [this message]
2008-12-09 18:21 ` [PATCH 3/8] cleanup careful_allocation(): bootmem already panics Dave Hansen
2008-12-09 18:21 ` [PATCH 4/8] make careful_allocation() return vaddrs Dave Hansen
2008-12-09 18:21 ` [PATCH 5/8] cleanup careful_allocation(): consolidate memset() Dave Hansen
2008-12-09 18:21 ` [PATCH 6/8] cleanup do_init_bootmem() Dave Hansen
2008-12-09 21:54   ` Serge E. Hallyn
2008-12-16  5:06   ` Paul Mackerras
2008-12-09 18:21 ` [PATCH 7/8] less use of NODE_DATA() Dave Hansen
2008-12-16  5:16   ` Paul Mackerras
2008-12-09 18:21 ` [PATCH 8/8] make free_bootmem_with_active_regions() take pgdat Dave Hansen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081209182132.9C2A37FD@kernel \
    --to=dave@linux.vnet.ibm.com \
    --cc=kniht@linux.vnet.ibm.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mel@csn.ul.ie \
    --cc=paulus@samba.org \
    --cc=serue@us.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.