提交 d0048b0e 编写于 作者: B Bob Liu 提交者: Linus Torvalds

page_alloc: break early in check_for_regular_memory()

If there is a zone below ZONE_NORMAL has present_pages, we can set node
state to N_NORMAL_MEMORY, no need to loop to end.
Signed-off-by: NBob Liu <lliubbo@gmail.com>
Acked-by: NMichal Hocko <mhocko@suse.cz>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: NKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 3ed28fa1
...@@ -4642,8 +4642,10 @@ static void check_for_regular_memory(pg_data_t *pgdat) ...@@ -4642,8 +4642,10 @@ static void check_for_regular_memory(pg_data_t *pgdat)
for (zone_type = 0; zone_type <= ZONE_NORMAL; zone_type++) { for (zone_type = 0; zone_type <= ZONE_NORMAL; zone_type++) {
struct zone *zone = &pgdat->node_zones[zone_type]; struct zone *zone = &pgdat->node_zones[zone_type];
if (zone->present_pages) if (zone->present_pages) {
node_set_state(zone_to_nid(zone), N_NORMAL_MEMORY); node_set_state(zone_to_nid(zone), N_NORMAL_MEMORY);
break;
}
} }
#endif #endif
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册