[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1358855156-6126-3-git-send-email-tangchen@cn.fujitsu.com>
Date: Tue, 22 Jan 2013 19:45:53 +0800
From: Tang Chen <tangchen@...fujitsu.com>
To: akpm@...ux-foundation.org, rjw@...k.pl, len.brown@...el.com,
mingo@...hat.com, tglx@...utronix.de, minchan.kim@...il.com,
rientjes@...gle.com, benh@...nel.crashing.org, paulus@...ba.org,
cl@...ux.com, kosaki.motohiro@...fujitsu.com,
isimatu.yasuaki@...fujitsu.com, wujianguo@...wei.com,
wency@...fujitsu.com, hpa@...or.com, linfeng@...fujitsu.com,
laijs@...fujitsu.com, mgorman@...e.de, yinghai@...nel.org,
glommer@...allels.com, jiang.liu@...wei.com,
julian.calaby@...il.com, sfr@...b.auug.org.au
Cc: x86@...nel.org, linux-mm@...ck.org, linux-kernel@...r.kernel.org,
linuxppc-dev@...ts.ozlabs.org, linux-acpi@...r.kernel.org,
Jiang Liu <liuj97@...il.com>, Mel Gorman <mel@....ul.ie>,
Peter Zijlstra <peterz@...radead.org>
Subject: [PATCH Bug fix 2/5] memory-hotplug: export the function try_offline_node()
From: Wen Congyang <wency@...fujitsu.com>
The node will be offlined when all memory/cpu on the node
have been hotremoved. So we need the function try_offline_node()
in cpu-hotplug path.
If the memory-hotplug is disabled, and cpu-hotplug is enabled
1. no memory no the node
we don't online the node, and cpu's node is the nearest node.
2. the node contains some memory
the node has been onlined, and cpu's node is still needed
to migrate the sleep task on the cpu to the same node.
So we do nothing in try_offline_node() in this case.
Cc: Yasuaki Ishimatsu <isimatu.yasuaki@...fujitsu.com>
Cc: David Rientjes <rientjes@...gle.com>
Cc: Jiang Liu <liuj97@...il.com>
Cc: Minchan Kim <minchan.kim@...il.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Mel Gorman <mel@....ul.ie>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Ingo Molnar <mingo@...hat.com>
Cc: "H. Peter Anvin" <hpa@...or.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Tang Chen <tangchen@...fujitsu.com>
Signed-off-by: Wen Congyang <wency@...fujitsu.com>
Signed-off-by: Tang Chen <tangchen@...fujitsu.com>
---
include/linux/memory_hotplug.h | 2 ++
mm/memory_hotplug.c | 3 ++-
2 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h
index 69903cc..0b2878e 100644
--- a/include/linux/memory_hotplug.h
+++ b/include/linux/memory_hotplug.h
@@ -193,6 +193,7 @@ extern void get_page_bootmem(unsigned long ingo, struct page *page,
void lock_memory_hotplug(void);
void unlock_memory_hotplug(void);
+extern void try_offline_node(int nid);
#else /* ! CONFIG_MEMORY_HOTPLUG */
/*
@@ -227,6 +228,7 @@ static inline void register_page_bootmem_info_node(struct pglist_data *pgdat)
static inline void lock_memory_hotplug(void) {}
static inline void unlock_memory_hotplug(void) {}
+static inline void try_offline_node(int nid) {}
#endif /* ! CONFIG_MEMORY_HOTPLUG */
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index f0dc9ad..edd1773 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -1703,7 +1703,7 @@ static int check_cpu_on_node(void *data)
}
/* offline the node if all memory sections of this node are removed */
-static void try_offline_node(int nid)
+void try_offline_node(int nid)
{
pg_data_t *pgdat = NODE_DATA(nid);
unsigned long start_pfn = pgdat->node_start_pfn;
@@ -1759,6 +1759,7 @@ static void try_offline_node(int nid)
*/
memset(pgdat, 0, sizeof(*pgdat));
}
+EXPORT_SYMBOL(try_offline_node);
int __ref remove_memory(int nid, u64 start, u64 size)
{
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists