From: Yasunori Goto <y-goto@jp.fujitsu.com>
To: Badari Pulavarty <pbadari@us.ibm.com>
Cc: Linux Kernel ML <linux-kernel@vger.kernel.org>,
linux-mm <linux-mm@kvack.org>, Yinghai Lu <yhlu.kernel@gmail.com>,
Andrew Morton <akpm@osdl.org>
Subject: [PATCH 3/3 (RFC)](memory hotplug) align maps for easy removing
Date: Fri, 14 Mar 2008 23:44:35 +0900 [thread overview]
Message-ID: <20080314234205.20DD.E1E9C6FF@jp.fujitsu.com> (raw)
In-Reply-To: <20080314231112.20D7.E1E9C6FF@jp.fujitsu.com>
To free memmap and usemap easier, this patch aligns these maps to page size.
I know usemap size is too small to align page size.
It will be waste of area. So, there may be better way than this.
Followings are pros. and cons with other my ideas.
But I'm not sure which is better way.
a) Packing many section's usemap on one page. Count how many sections use
it in page_count.
Pros.
- Avoid waisting area.
Cons.
- This usemap's page will be hard(or impossible) to remove due to
dependency.
It should be allocated on un-movable zone/node.
(I'm not sure it's impact of performance.)
- Nodes' structures may have to be packed like usemap???
b) Pack memmap and usemap in one allocation.
Pros.
- May avoid wasting area if its size is suitable.
Cons.
- If size is not suitable, it will be same as this patch.
- This way is not good for VMEMMAP_SPARSEMEM.
At least, it is reverse way against Yinghai-san's fix.
c) This way.
Pros.
- Very easy to remove.
Cons.
- Waist of area.
Any other idea is welcome.
Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>
---
mm/sparse.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
Index: current/mm/sparse.c
===================================================================
--- current.orig/mm/sparse.c 2008-03-11 20:15:41.000000000 +0900
+++ current/mm/sparse.c 2008-03-11 20:58:18.000000000 +0900
@@ -244,7 +244,8 @@
struct mem_section *ms = __nr_to_section(pnum);
int nid = sparse_early_nid(ms);
- usemap = alloc_bootmem_node(NODE_DATA(nid), usemap_size());
+ usemap = alloc_bootmem_pages_node(NODE_DATA(nid),
+ PAGE_ALIGN(usemap_size()));
if (usemap)
return usemap;
@@ -264,8 +265,8 @@
if (map)
return map;
- map = alloc_bootmem_node(NODE_DATA(nid),
- sizeof(struct page) * PAGES_PER_SECTION);
+ map = alloc_bootmem_pages_node(NODE_DATA(nid),
+ PAGE_ALIGN(sizeof(struct page) * PAGES_PER_SECTION));
return map;
}
#endif /* !CONFIG_SPARSEMEM_VMEMMAP */
--
Yasunori Goto
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2008-03-14 14:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-14 14:36 [PATCH 0/3 (RFC)](memory hotplug) freeing pages allocated by bootmem for hotremove Yasunori Goto
2008-03-14 14:38 ` [PATCH 1/3 (RFC)](memory hotplug) remember section_nr and node id for removing Yasunori Goto
2008-03-14 14:41 ` [PATCH 2/3 (RFC)](memory hotplug) free pages allocated by bootmem for hotremove Yasunori Goto
2008-03-14 14:44 ` Yasunori Goto [this message]
2008-03-14 16:26 ` [PATCH 3/3 (RFC)](memory hotplug) align maps for easy removing Yinghai Lu
2008-03-15 4:12 ` Yasunori Goto
2008-03-21 17:05 ` [PATCH 0/3 (RFC)](memory hotplug) freeing pages allocated by bootmem for hotremove Badari Pulavarty
2008-03-22 0:09 ` Yasunori Goto
2008-03-26 22:08 ` Badari Pulavarty
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=20080314234205.20DD.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