aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMinchan Kim <minchan.kim@gmail.com>2009-06-16 18:32:48 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-16 22:47:41 -0400
commitbc75d33f0fc1d56e734db1f56d3cfc8097b8e0cf (patch)
tree4dc5054afdff491d8378dee2a235da64d6ad3de6
parentb70d94ee438b3fd9c15c7691d7a932a135c18101 (diff)
page-allocator: clean up functions related to pages_min
Change the names of two functions. It doesn't affect behavior. Presently, setup_per_zone_pages_min() changes low, high of zone as well as min. So a better name is setup_per_zone_wmarks(). That's because Mel changed zone->pages_[hig/low/min] to zone->watermark array in "page allocator: replace the watermark-related union in struct zone with a watermark[] array". * setup_per_zone_pages_min => setup_per_zone_wmarks Of course, we have to change init_per_zone_pages_min, too. There are not pages_min any more. * init_per_zone_pages_min => init_per_zone_wmark_min [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Minchan Kim <minchan.kim@gmail.com> Acked-by: Mel Gorman <mel@csn.ul.ie> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Cc: Rik van Riel <riel@redhat.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--include/linux/mm.h2
-rw-r--r--mm/memory_hotplug.c2
-rw-r--r--mm/page_alloc.c17
3 files changed, 11 insertions, 10 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index c80dbd4a62c6..6e11cda1ba02 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1052,7 +1052,7 @@ extern int __meminit __early_pfn_to_nid(unsigned long pfn);
1052extern void set_dma_reserve(unsigned long new_dma_reserve); 1052extern void set_dma_reserve(unsigned long new_dma_reserve);
1053extern void memmap_init_zone(unsigned long, int, unsigned long, 1053extern void memmap_init_zone(unsigned long, int, unsigned long,
1054 unsigned long, enum memmap_context); 1054 unsigned long, enum memmap_context);
1055extern void setup_per_zone_pages_min(void); 1055extern void setup_per_zone_wmarks(void);
1056extern void mem_init(void); 1056extern void mem_init(void);
1057extern void __init mmap_init(void); 1057extern void __init mmap_init(void);
1058extern void show_mem(void); 1058extern void show_mem(void);
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index c083cf5fd6df..037291e15b27 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -422,7 +422,7 @@ int online_pages(unsigned long pfn, unsigned long nr_pages)
422 zone->present_pages += onlined_pages; 422 zone->present_pages += onlined_pages;
423 zone->zone_pgdat->node_present_pages += onlined_pages; 423 zone->zone_pgdat->node_present_pages += onlined_pages;
424 424
425 setup_per_zone_pages_min(); 425 setup_per_zone_wmarks();
426 if (onlined_pages) { 426 if (onlined_pages) {
427 kswapd_run(zone_to_nid(zone)); 427 kswapd_run(zone_to_nid(zone));
428 node_set_state(zone_to_nid(zone), N_HIGH_MEMORY); 428 node_set_state(zone_to_nid(zone), N_HIGH_MEMORY);
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 5b09488d0f55..8629c84fd9ba 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -4396,12 +4396,13 @@ static void setup_per_zone_lowmem_reserve(void)
4396} 4396}
4397 4397
4398/** 4398/**
4399 * setup_per_zone_pages_min - called when min_free_kbytes changes. 4399 * setup_per_zone_wmarks - called when min_free_kbytes changes
4400 * or when memory is hot-added
4400 * 4401 *
4401 * Ensures that the pages_{min,low,high} values for each zone are set correctly 4402 * Ensures that the watermark[min,low,high] values for each zone are set
4402 * with respect to min_free_kbytes. 4403 * correctly with respect to min_free_kbytes.
4403 */ 4404 */
4404void setup_per_zone_pages_min(void) 4405void setup_per_zone_wmarks(void)
4405{ 4406{
4406 unsigned long pages_min = min_free_kbytes >> (PAGE_SHIFT - 10); 4407 unsigned long pages_min = min_free_kbytes >> (PAGE_SHIFT - 10);
4407 unsigned long lowmem_pages = 0; 4408 unsigned long lowmem_pages = 0;
@@ -4519,7 +4520,7 @@ static void __init setup_per_zone_inactive_ratio(void)
4519 * 8192MB: 11584k 4520 * 8192MB: 11584k
4520 * 16384MB: 16384k 4521 * 16384MB: 16384k
4521 */ 4522 */
4522static int __init init_per_zone_pages_min(void) 4523static int __init init_per_zone_wmark_min(void)
4523{ 4524{
4524 unsigned long lowmem_kbytes; 4525 unsigned long lowmem_kbytes;
4525 4526
@@ -4530,12 +4531,12 @@ static int __init init_per_zone_pages_min(void)
4530 min_free_kbytes = 128; 4531 min_free_kbytes = 128;
4531 if (min_free_kbytes > 65536) 4532 if (min_free_kbytes > 65536)
4532 min_free_kbytes = 65536; 4533 min_free_kbytes = 65536;
4533 setup_per_zone_pages_min(); 4534 setup_per_zone_wmarks();
4534 setup_per_zone_lowmem_reserve(); 4535 setup_per_zone_lowmem_reserve();
4535 setup_per_zone_inactive_ratio(); 4536 setup_per_zone_inactive_ratio();
4536 return 0; 4537 return 0;
4537} 4538}
4538module_init(init_per_zone_pages_min) 4539module_init(init_per_zone_wmark_min)
4539 4540
4540/* 4541/*
4541 * min_free_kbytes_sysctl_handler - just a wrapper around proc_dointvec() so 4542 * min_free_kbytes_sysctl_handler - just a wrapper around proc_dointvec() so
@@ -4547,7 +4548,7 @@ int min_free_kbytes_sysctl_handler(ctl_table *table, int write,
4547{ 4548{
4548 proc_dointvec(table, write, file, buffer, length, ppos); 4549 proc_dointvec(table, write, file, buffer, length, ppos);
4549 if (write) 4550 if (write)
4550 setup_per_zone_pages_min(); 4551 setup_per_zone_wmarks();
4551 return 0; 4552 return 0;
4552} 4553}
4553 4554