Skip to content

Commit 79a4dce

Browse files
tang-chentorvalds
authored andcommitted
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>
1 parent 7179e7b commit 79a4dce

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

mm/memory_hotplug.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -590,18 +590,21 @@ static int online_pages_range(unsigned long start_pfn, unsigned long nr_pages,
590590
}
591591

592592
#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+
*/
594597
static bool can_online_high_movable(struct zone *zone)
595598
{
596599
return true;
597600
}
598-
#else /* #ifdef CONFIG_MOVABLE_NODE */
601+
#else /* CONFIG_MOVABLE_NODE */
599602
/* ensure every online node has NORMAL memory */
600603
static bool can_online_high_movable(struct zone *zone)
601604
{
602605
return node_state(zone_to_nid(zone), N_NORMAL_MEMORY);
603606
}
604-
#endif /* #ifdef CONFIG_MOVABLE_NODE */
607+
#endif /* CONFIG_MOVABLE_NODE */
605608

606609
/* check which state of node_states will be changed when online memory */
607610
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)
11121115
}
11131116

11141117
#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+
*/
11161122
static bool can_offline_normal(struct zone *zone, unsigned long nr_pages)
11171123
{
11181124
return true;
11191125
}
1120-
#else /* #ifdef CONFIG_MOVABLE_NODE */
1126+
#else /* CONFIG_MOVABLE_NODE */
11211127
/* ensure the node has NORMAL memory if it is still online */
11221128
static bool can_offline_normal(struct zone *zone, unsigned long nr_pages)
11231129
{
@@ -1141,7 +1147,7 @@ static bool can_offline_normal(struct zone *zone, unsigned long nr_pages)
11411147
*/
11421148
return present_pages == 0;
11431149
}
1144-
#endif /* #ifdef CONFIG_MOVABLE_NODE */
1150+
#endif /* CONFIG_MOVABLE_NODE */
11451151

11461152
/* check which state of node_states will be changed when offline memory */
11471153
static void node_states_check_changes_offline(unsigned long nr_pages,

0 commit comments

Comments
 (0)