From: Zhang Yanfei <zhangyanfei@xxxxxxxxxxxxxx> This function actually counts RAM pages that are above high watermark within all zones, so rename it to a reasonable name. Signed-off-by: Zhang Yanfei <zhangyanfei@xxxxxxxxxxxxxx> --- include/linux/swap.h | 2 +- mm/memory_hotplug.c | 4 ++-- mm/page_alloc.c | 7 ++++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/linux/swap.h b/include/linux/swap.h index 0df8905..9a8ab19 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -217,7 +217,7 @@ extern unsigned long totalram_pages; extern unsigned long totalreserve_pages; extern unsigned long dirty_balance_reserve; extern unsigned int nr_free_buffer_high_pages(void); -extern unsigned int nr_free_pagecache_pages(void); +extern unsigned int nr_free_pagecache_high_pages(void); /* Definition of global_page_state not available yet */ #define nr_free_pages() global_page_state(NR_FREE_PAGES) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index d04ed87..6e482c7 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -777,7 +777,7 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages, int online_typ if (onlined_pages) kswapd_run(zone_to_nid(zone)); - vm_total_pages = nr_free_pagecache_pages(); + vm_total_pages = nr_free_pagecache_high_pages(); writeback_set_ratelimit(); @@ -1356,7 +1356,7 @@ repeat: if (arg.status_change_nid >= 0) kswapd_stop(node); - vm_total_pages = nr_free_pagecache_pages(); + vm_total_pages = nr_free_pagecache_high_pages(); writeback_set_ratelimit(); memory_notify(MEM_OFFLINE, &arg); diff --git a/mm/page_alloc.c b/mm/page_alloc.c index a021d91..6e0d91a 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -2816,9 +2816,10 @@ unsigned int nr_free_buffer_high_pages(void) EXPORT_SYMBOL_GPL(nr_free_buffer_high_pages); /* - * Amount of free RAM allocatable within all zones + * Amount of free RAM allocatable that is above high watermark + * within all zones */ -unsigned int nr_free_pagecache_pages(void) +unsigned int nr_free_pagecache_high_pages(void) { return nr_free_zone_high_pages(gfp_zone(GFP_HIGHUSER_MOVABLE)); } @@ -3649,7 +3650,7 @@ void __ref build_all_zonelists(pg_data_t *pgdat, struct zone *zone) stop_machine(__build_all_zonelists, pgdat, NULL); /* cpuset refresh routine should be here */ } - vm_total_pages = nr_free_pagecache_pages(); + vm_total_pages = nr_free_pagecache_high_pages(); /* * Disable grouping by mobility if the number of pages in the * system is too low to allow the mechanism to work. It would be -- 1.7.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>