linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/3] page_alloc: break early in check_for_regular_memory()
@ 2011-12-20 10:02 Bob Liu
  2011-12-20 14:31 ` Michal Hocko
  2011-12-21  0:17 ` KAMEZAWA Hiroyuki
  0 siblings, 2 replies; 3+ messages in thread
From: Bob Liu @ 2011-12-20 10:02 UTC (permalink / raw)
  To: linux-mm; +Cc: akpm, mgorman, tj, kamezawa.hiroyu, aarcange, Bob Liu

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: Bob Liu <lliubbo@gmail.com>
---
 mm/page_alloc.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 7f28eb8..8d64ba0 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -4671,8 +4671,10 @@ static void check_for_regular_memory(pg_data_t *pgdat)
 
 	for (zone_type = 0; zone_type <= ZONE_NORMAL; 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);
+			break;
+		}
 	}
 #endif
 }
-- 
1.7.0.4


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-12-21  0:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-20 10:02 [PATCH 2/3] page_alloc: break early in check_for_regular_memory() Bob Liu
2011-12-20 14:31 ` Michal Hocko
2011-12-21  0:17 ` KAMEZAWA Hiroyuki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox