page_alloc: break early in check_for_regular_memory()
Subsystems (2)
PATCH 2/3 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 Bob Liu <[email protected]>
--- mm/page_alloc.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
mm/page_alloc.c +3 -1
@@ -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 }
Signature · 9 lines
1.7.0.4 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. 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:"[email protected]"> [email protected] </a>
Quoted 4 lines · Bob Liu
If there is a zone below
ZONE_NORMALhaspresent_pages, we can set node state toN_NORMAL_MEMORY, no need to loop to end.Signed-off-by Bob Liu <[email protected]>
Looks good.
Reviewed-by Michal Hocko <[email protected]>
Thanks
Quoted 30 lines
--- mm/page_alloc.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)mm/page_alloc.c +3
-1@@ -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 }Signature · 9 lines
1.7.0.4 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. 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:"[email protected]"> [email protected] </a>
Signature · 13 lines
Michal Hocko SUSE Labs SUSE LINUX s.r.o. Lihovarska 1060/12 190 00 Praha 9 Czech Republic -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. 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:"[email protected]"> [email protected] </a>
Quoted 4 lines · On Tue, 20 Dec 2011 18:02:39 +0800 Bob Liu <[email protected]> wrote:
If there is a zone below
ZONE_NORMALhaspresent_pages, we can set node state toN_NORMAL_MEMORY, no need to loop to end.Signed-off-by Bob Liu <[email protected]>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. 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:"[email protected]"> [email protected] </a>