From: Yasunori Goto <y-goto@jp.fujitsu.com>
To: Andy Whitcroft <apw@shadowen.org>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Badari Pulavarty <pbadari@us.ibm.com>,
Linux Kernel ML <linux-kernel@vger.kernel.org>,
linux-mm <linux-mm@kvack.org>, Yinghai Lu <yhlu.kernel@gmail.com>
Subject: [Patch](memory hotplug) Tiny fixes of bootmem free patch for memory hotremove
Date: Tue, 17 Jun 2008 20:39:04 +0900 [thread overview]
Message-ID: <20080617203343.C208.E1E9C6FF@jp.fujitsu.com> (raw)
In-Reply-To: <20080616204200.9E9F.E1E9C6FF@jp.fujitsu.com>
Here is tiny fixes of bootmem free patch for memory hotremove.
- Change some naming
* Magic -> types
* MIX_INFO -> MIX_SECTION_INFO
* Change definition of bootmem type from direct hex value
- __free_pages_bootmem() becomes __meminit.
This is for 2.6.26-rc5-mm3.
Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>
---
include/linux/memory_hotplug.h | 8 ++++----
mm/memory_hotplug.c | 12 ++++++------
mm/page_alloc.c | 2 +-
3 files changed, 11 insertions(+), 11 deletions(-)
Index: current/include/linux/memory_hotplug.h
===================================================================
--- current.orig/include/linux/memory_hotplug.h 2008-06-10 20:23:30.000000000 +0900
+++ current/include/linux/memory_hotplug.h 2008-06-17 20:30:14.000000000 +0900
@@ -13,12 +13,12 @@
#ifdef CONFIG_MEMORY_HOTPLUG
/*
- * Magic number for free bootmem.
+ * Types for free bootmem.
* The normal smallest mapcount is -1. Here is smaller value than it.
*/
-#define SECTION_INFO 0xfffffffe
-#define MIX_INFO 0xfffffffd
-#define NODE_INFO 0xfffffffc
+#define SECTION_INFO (-1 - 1)
+#define MIX_SECTION_INFO (-1 - 2)
+#define NODE_INFO (-1 - 3)
/*
* pgdat resizing functions
Index: current/mm/memory_hotplug.c
===================================================================
--- current.orig/mm/memory_hotplug.c 2008-06-17 15:34:29.000000000 +0900
+++ current/mm/memory_hotplug.c 2008-06-17 20:31:59.000000000 +0900
@@ -62,9 +62,9 @@
#ifdef CONFIG_MEMORY_HOTPLUG_SPARSE
#ifndef CONFIG_SPARSEMEM_VMEMMAP
-static void get_page_bootmem(unsigned long info, struct page *page, int magic)
+static void get_page_bootmem(unsigned long info, struct page *page, int type)
{
- atomic_set(&page->_mapcount, magic);
+ atomic_set(&page->_mapcount, type);
SetPagePrivate(page);
set_page_private(page, info);
atomic_inc(&page->_count);
@@ -72,10 +72,10 @@
void put_page_bootmem(struct page *page)
{
- int magic;
+ int type;
- magic = atomic_read(&page->_mapcount);
- BUG_ON(magic >= -1);
+ type = atomic_read(&page->_mapcount);
+ BUG_ON(type >= -1);
if (atomic_dec_return(&page->_count) == 1) {
ClearPagePrivate(page);
@@ -119,7 +119,7 @@
mapsize = PAGE_ALIGN(usemap_size()) >> PAGE_SHIFT;
for (i = 0; i < mapsize; i++, page++)
- get_page_bootmem(section_nr, page, MIX_INFO);
+ get_page_bootmem(section_nr, page, MIX_SECTION_INFO);
}
Index: current/mm/page_alloc.c
===================================================================
--- current.orig/mm/page_alloc.c 2008-06-17 15:34:29.000000000 +0900
+++ current/mm/page_alloc.c 2008-06-17 20:08:47.000000000 +0900
@@ -583,7 +583,7 @@
/*
* permit the bootmem allocator to evade page validation on high-order frees
*/
-void __free_pages_bootmem(struct page *page, unsigned int order)
+void __meminit __free_pages_bootmem(struct page *page, unsigned int order)
{
if (order == 0) {
__ClearPageReserved(page);
--
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-06-17 11:39 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-07 12:43 [Patch 000/005](memory hotplug) freeing pages allocated by bootmem for hotremove v3 Yasunori Goto
2008-04-07 12:45 ` [Patch 001/005](memory hotplug) register section/node id to free Yasunori Goto
2008-06-16 10:21 ` Andy Whitcroft
2008-06-16 13:58 ` Yasunori Goto
2008-06-17 11:39 ` Yasunori Goto [this message]
2008-04-07 12:46 ` [Patch 002/005](memory hotplug) align memmap to page size Yasunori Goto
2008-06-16 10:26 ` Andy Whitcroft
2008-06-16 13:26 ` Yasunori Goto
2008-04-07 12:47 ` [Patch 003/005](memory hotplug) make alloc_bootmem_section() Yasunori Goto
2008-06-16 10:32 ` Andy Whitcroft
2008-06-16 13:18 ` Yasunori Goto
2008-04-07 12:48 ` [Patch 004/005](memory hotplug)allocate usemap on the section with pgdat Yasunori Goto
2008-04-07 12:50 ` [Patch 005/005](memory hotplug) free memmaps allocated by bootmem Yasunori Goto
2008-06-16 10:44 ` Andy Whitcroft
2008-06-16 14:09 ` 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=20080617203343.C208.E1E9C6FF@jp.fujitsu.com \
--to=y-goto@jp.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=apw@shadowen.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