/* setup_per_zone_lowmem_reserve - called whenever sysctl_lower_zone_reserve_ratio changes. Ensures that each zone has a correct pages reserved value, so an adequate number of pages are left in the zone after a successful __alloc_pages().  */
static void setup_per_zone_lowmem_reserve(void)
/* setup_per_zone_lowmem_reserve - called whenever sysctl_lower_zone_reserve_ratio changes. Ensures that each zone has a correct pages reserved value, so an adequate number of pages are left in the zone after a successful __alloc_pages().  */
static void setup_per_zone_lowmem_reserve(void)
{
	struct pglist_data *pgdat;
	enum zone_type j, idx;
	for_each_online_pgdat(pgdat) {
		for (j = 0; j < MAX_NR_ZONES; j++) {
			struct zone *zone = pgdat->node_zones + j;
			unsigned long present_pages = zone->present_pages;
			zone->lowmem_reserve[j] = 0;
			idx = j;
			while (idx) {
				struct zone *lower_zone;
				idx--;
				if (sysctl_lowmem_reserve_ratio[idx] < 1)
					sysctl_lowmem_reserve_ratio[idx] = 1;
				lower_zone = pgdat->node_zones + idx;
				lower_zone->lowmem_reserve[j] = present_pages /
					sysctl_lowmem_reserve_ratio[idx];
				present_pages += lower_zone->present_pages;
			}
		}
	}
	calculate_totalreserve_pages();
}