linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yasunori Goto <y-goto@jp.fujitsu.com>
To: Badari Pulavarty <pbadari@us.ibm.com>
Cc: Andrew Morton <akpm@osdl.org>,
	Linux Kernel ML <linux-kernel@vger.kernel.org>,
	Yinghai Lu <yhlu.kernel@gmail.com>, linux-mm <linux-mm@kvack.org>
Subject: [Patch 004/005](memory hotplug)allocate usemap on the section with pgdat
Date: Thu, 03 Apr 2008 14:44:22 +0900	[thread overview]
Message-ID: <20080403144159.D1FE.E1E9C6FF@jp.fujitsu.com> (raw)
In-Reply-To: <20080403140221.D1F2.E1E9C6FF@jp.fujitsu.com>



Usemaps are allocated on the section which has pgdat by this.

Because usemap size is very small, many usemaps for sections
are allocated on only one page. The page will be quite hard to
be removed until removing all other sections.
This dependency is not desirable for memory removing.

Pgdat has similar feature. If sections has pgdat area, it 
must be the last section for removing on the node.

This is to collect the cause pages of its dependency on one section.
If other sections doesn't have any dependency, this section will
be able to be removed finally.


Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>


 mm/sparse.c |   16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

Index: current/mm/sparse.c
===================================================================
--- current.orig/mm/sparse.c	2008-04-01 20:59:07.000000000 +0900
+++ current/mm/sparse.c	2008-04-01 20:59:09.000000000 +0900
@@ -238,13 +238,23 @@
 }
 #endif /* CONFIG_MEMORY_HOTPLUG */
 
-static unsigned long *__init sparse_early_usemap_alloc(unsigned long pnum)
+static unsigned long *__init sparse_early_usemap_alloc(int pnum)
 {
-	unsigned long *usemap;
+	unsigned long *usemap, section_nr;
 	struct mem_section *ms = __nr_to_section(pnum);
 	int nid = sparse_early_nid(ms);
+	struct pglist_data *pgdat = NODE_DATA(nid);
+
+	/*
+	 * This is allocated on same section of pgdat.
+	 * It will not be freed until other sections hot-removing on the node.
+	 * Pgdat has same feature. This collects all usemap on the same
+	 * section.
+	 */
+
+	section_nr = pfn_to_section_nr(__pa(pgdat) >> PAGE_SHIFT);
+	usemap = alloc_bootmem_section(usemap_size(), section_nr);
 
-	usemap = alloc_bootmem_node(NODE_DATA(nid), usemap_size());
 	if (usemap)
 		return usemap;
 

-- 
Yasunori Goto 

  parent reply	other threads:[~2008-04-03  5:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-03  5:37 [Patch 000/005](memory hotplug) freeing pages allocated by bootmem for hotremove v2 Yasunori Goto
2008-04-03  5:39 ` [Patch 001/005](memory hotplug) register sectin/node id to free Yasunori Goto
2008-04-03  5:40 ` [Patch 002/005](memory hotplug) align memmap to page size Yasunori Goto
2008-04-03  5:41 ` [Patch 003/005](memory hotplug) make alloc_bootmem_section() Yasunori Goto
2008-04-03  5:52   ` Yinghai Lu
2008-04-03  6:07     ` Yasunori Goto
2008-04-03  5:44 ` Yasunori Goto [this message]
2008-04-03  5:45 ` [Patch 005/005](memory hotplug) free memmaps allocated by bootmem Yasunori Goto
2008-04-07 12:43 [Patch 000/005](memory hotplug) freeing pages allocated by bootmem for hotremove v3 Yasunori Goto
2008-04-07 12:48 ` [Patch 004/005](memory hotplug)allocate usemap on the section with pgdat Yasunori Goto

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=20080403144159.D1FE.E1E9C6FF@jp.fujitsu.com \
    --to=y-goto@jp.fujitsu.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=pbadari@us.ibm.com \
    --cc=yhlu.kernel@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox