aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorTang Chen <tangchen@cn.fujitsu.com>2012-12-18 17:23:24 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-18 18:02:15 -0500
commit79a4dcefd3256896416f5a94d2d1442a7f5aa9b8 (patch)
tree4a00cd22e719484b1bf40fab95eda98070c7550a /mm
parent7179e7bf4592ac5a7b30257a7df6259ee81e51da (diff)
mm/memory_hotplug.c: improve comments
Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com> Cc: Jiang Liu <jiang.liu@huawei.com> Cc: Lai Jiangshan <laijs@cn.fujitsu.com> Cc: Wen Congyang <wency@cn.fujitsu.com> Cc: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/memory_hotplug.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 962e353aa86f..d04ed87bfacb 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -590,18 +590,21 @@ static int online_pages_range(unsigned long start_pfn, unsigned long nr_pages,
590} 590}
591 591
592#ifdef CONFIG_MOVABLE_NODE 592#ifdef CONFIG_MOVABLE_NODE
593/* when CONFIG_MOVABLE_NODE, we allow online node don't have normal memory */ 593/*
594 * When CONFIG_MOVABLE_NODE, we permit onlining of a node which doesn't have
595 * normal memory.
596 */
594static bool can_online_high_movable(struct zone *zone) 597static bool can_online_high_movable(struct zone *zone)
595{ 598{
596 return true; 599 return true;
597} 600}
598#else /* #ifdef CONFIG_MOVABLE_NODE */ 601#else /* CONFIG_MOVABLE_NODE */
599/* ensure every online node has NORMAL memory */ 602/* ensure every online node has NORMAL memory */
600static bool can_online_high_movable(struct zone *zone) 603static bool can_online_high_movable(struct zone *zone)
601{ 604{
602 return node_state(zone_to_nid(zone), N_NORMAL_MEMORY); 605 return node_state(zone_to_nid(zone), N_NORMAL_MEMORY);
603} 606}
604#endif /* #ifdef CONFIG_MOVABLE_NODE */ 607#endif /* CONFIG_MOVABLE_NODE */
605 608
606/* check which state of node_states will be changed when online memory */ 609/* check which state of node_states will be changed when online memory */
607static void node_states_check_changes_online(unsigned long nr_pages, 610static void node_states_check_changes_online(unsigned long nr_pages,
@@ -1112,12 +1115,15 @@ check_pages_isolated(unsigned long start_pfn, unsigned long end_pfn)
1112} 1115}
1113 1116
1114#ifdef CONFIG_MOVABLE_NODE 1117#ifdef CONFIG_MOVABLE_NODE
1115/* when CONFIG_MOVABLE_NODE, we allow online node don't have normal memory */ 1118/*
1119 * When CONFIG_MOVABLE_NODE, we permit offlining of a node which doesn't have
1120 * normal memory.
1121 */
1116static bool can_offline_normal(struct zone *zone, unsigned long nr_pages) 1122static bool can_offline_normal(struct zone *zone, unsigned long nr_pages)
1117{ 1123{
1118 return true; 1124 return true;
1119} 1125}
1120#else /* #ifdef CONFIG_MOVABLE_NODE */ 1126#else /* CONFIG_MOVABLE_NODE */
1121/* ensure the node has NORMAL memory if it is still online */ 1127/* ensure the node has NORMAL memory if it is still online */
1122static bool can_offline_normal(struct zone *zone, unsigned long nr_pages) 1128static bool can_offline_normal(struct zone *zone, unsigned long nr_pages)
1123{ 1129{
@@ -1141,7 +1147,7 @@ static bool can_offline_normal(struct zone *zone, unsigned long nr_pages)
1141 */ 1147 */
1142 return present_pages == 0; 1148 return present_pages == 0;
1143} 1149}
1144#endif /* #ifdef CONFIG_MOVABLE_NODE */ 1150#endif /* CONFIG_MOVABLE_NODE */
1145 1151
1146/* check which state of node_states will be changed when offline memory */ 1152/* check which state of node_states will be changed when offline memory */
1147static void node_states_check_changes_offline(unsigned long nr_pages, 1153static void node_states_check_changes_offline(unsigned long nr_pages,