/* calculate_totalreserve_pages - called when sysctl_lower_zone_reserve_ratio or min_free_kbytes changes.  */
static void calculate_totalreserve_pages(void)
/* calculate_totalreserve_pages - called when sysctl_lower_zone_reserve_ratio or min_free_kbytes changes.  */
static void calculate_totalreserve_pages(void)
{
	struct pglist_data *pgdat;
	unsigned long reserve_pages = 0;
	enum zone_type i, j;
	for_each_online_pgdat(pgdat) {
		for (i = 0; i < MAX_NR_ZONES; i++) {
			struct zone *zone = pgdat->node_zones + i;
			unsigned long max = 0;
			for (j = i; j < MAX_NR_ZONES; j++) {
				if (zone->lowmem_reserve[j] > max)
					max = zone->lowmem_reserve[j];
			}
			max += high_wmark_pages(zone);
			if (max > zone->present_pages)
				max = zone->present_pages;
			reserve_pages += max;
		}
	}
	totalreserve_pages = reserve_pages;
}