diff options
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r-- | mm/page_alloc.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 3e792a583f3b..54a4f5375bba 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -2005,6 +2005,10 @@ static void __meminit free_area_init_core(struct pglist_data *pgdat, | |||
2005 | 2005 | ||
2006 | zone->spanned_pages = size; | 2006 | zone->spanned_pages = size; |
2007 | zone->present_pages = realsize; | 2007 | zone->present_pages = realsize; |
2008 | #ifdef CONFIG_NUMA | ||
2009 | zone->min_unmapped_ratio = (realsize*sysctl_min_unmapped_ratio) | ||
2010 | / 100; | ||
2011 | #endif | ||
2008 | zone->name = zone_names[j]; | 2012 | zone->name = zone_names[j]; |
2009 | spin_lock_init(&zone->lock); | 2013 | spin_lock_init(&zone->lock); |
2010 | spin_lock_init(&zone->lru_lock); | 2014 | spin_lock_init(&zone->lru_lock); |
@@ -2298,6 +2302,24 @@ int min_free_kbytes_sysctl_handler(ctl_table *table, int write, | |||
2298 | return 0; | 2302 | return 0; |
2299 | } | 2303 | } |
2300 | 2304 | ||
2305 | #ifdef CONFIG_NUMA | ||
2306 | int sysctl_min_unmapped_ratio_sysctl_handler(ctl_table *table, int write, | ||
2307 | struct file *file, void __user *buffer, size_t *length, loff_t *ppos) | ||
2308 | { | ||
2309 | struct zone *zone; | ||
2310 | int rc; | ||
2311 | |||
2312 | rc = proc_dointvec_minmax(table, write, file, buffer, length, ppos); | ||
2313 | if (rc) | ||
2314 | return rc; | ||
2315 | |||
2316 | for_each_zone(zone) | ||
2317 | zone->min_unmapped_ratio = (zone->present_pages * | ||
2318 | sysctl_min_unmapped_ratio) / 100; | ||
2319 | return 0; | ||
2320 | } | ||
2321 | #endif | ||
2322 | |||
2301 | /* | 2323 | /* |
2302 | * lowmem_reserve_ratio_sysctl_handler - just a wrapper around | 2324 | * lowmem_reserve_ratio_sysctl_handler - just a wrapper around |
2303 | * proc_dointvec() so that we can call setup_per_zone_lowmem_reserve() | 2325 | * proc_dointvec() so that we can call setup_per_zone_lowmem_reserve() |