Commit 79a4dcef authored by Tang Chen's avatar Tang Chen Committed by Linus Torvalds

mm/memory_hotplug.c: improve comments

Signed-off-by: default avatarTang 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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 7179e7bf
...@@ -590,18 +590,21 @@ static int online_pages_range(unsigned long start_pfn, unsigned long nr_pages, ...@@ -590,18 +590,21 @@ static int online_pages_range(unsigned long start_pfn, unsigned long nr_pages,
} }
#ifdef CONFIG_MOVABLE_NODE #ifdef CONFIG_MOVABLE_NODE
/* when CONFIG_MOVABLE_NODE, we allow online node don't have normal memory */ /*
* When CONFIG_MOVABLE_NODE, we permit onlining of a node which doesn't have
* normal memory.
*/
static bool can_online_high_movable(struct zone *zone) static bool can_online_high_movable(struct zone *zone)
{ {
return true; return true;
} }
#else /* #ifdef CONFIG_MOVABLE_NODE */ #else /* CONFIG_MOVABLE_NODE */
/* ensure every online node has NORMAL memory */ /* ensure every online node has NORMAL memory */
static bool can_online_high_movable(struct zone *zone) static bool can_online_high_movable(struct zone *zone)
{ {
return node_state(zone_to_nid(zone), N_NORMAL_MEMORY); return node_state(zone_to_nid(zone), N_NORMAL_MEMORY);
} }
#endif /* #ifdef CONFIG_MOVABLE_NODE */ #endif /* CONFIG_MOVABLE_NODE */
/* check which state of node_states will be changed when online memory */ /* check which state of node_states will be changed when online memory */
static void node_states_check_changes_online(unsigned long nr_pages, static 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,12 +1115,15 @@ check_pages_isolated(unsigned long start_pfn, unsigned long end_pfn)
} }
#ifdef CONFIG_MOVABLE_NODE #ifdef CONFIG_MOVABLE_NODE
/* when CONFIG_MOVABLE_NODE, we allow online node don't have normal memory */ /*
* When CONFIG_MOVABLE_NODE, we permit offlining of a node which doesn't have
* normal memory.
*/
static bool can_offline_normal(struct zone *zone, unsigned long nr_pages) static bool can_offline_normal(struct zone *zone, unsigned long nr_pages)
{ {
return true; return true;
} }
#else /* #ifdef CONFIG_MOVABLE_NODE */ #else /* CONFIG_MOVABLE_NODE */
/* ensure the node has NORMAL memory if it is still online */ /* ensure the node has NORMAL memory if it is still online */
static bool can_offline_normal(struct zone *zone, unsigned long nr_pages) static bool can_offline_normal(struct zone *zone, unsigned long nr_pages)
{ {
...@@ -1141,7 +1147,7 @@ static bool can_offline_normal(struct zone *zone, unsigned long nr_pages) ...@@ -1141,7 +1147,7 @@ static bool can_offline_normal(struct zone *zone, unsigned long nr_pages)
*/ */
return present_pages == 0; return present_pages == 0;
} }
#endif /* #ifdef CONFIG_MOVABLE_NODE */ #endif /* CONFIG_MOVABLE_NODE */
/* check which state of node_states will be changed when offline memory */ /* check which state of node_states will be changed when offline memory */
static void node_states_check_changes_offline(unsigned long nr_pages, static void node_states_check_changes_offline(unsigned long nr_pages,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment