Commit bc75d33f authored by Minchan Kim's avatar Minchan Kim Committed by Linus Torvalds

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: default avatarMinchan Kim <minchan.kim@gmail.com>
Acked-by: default avatarMel 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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b70d94ee
...@@ -1052,7 +1052,7 @@ extern int __meminit __early_pfn_to_nid(unsigned long pfn); ...@@ -1052,7 +1052,7 @@ extern int __meminit __early_pfn_to_nid(unsigned long pfn);
extern void set_dma_reserve(unsigned long new_dma_reserve); extern void set_dma_reserve(unsigned long new_dma_reserve);
extern void memmap_init_zone(unsigned long, int, unsigned long, extern void memmap_init_zone(unsigned long, int, unsigned long,
unsigned long, enum memmap_context); unsigned long, enum memmap_context);
extern void setup_per_zone_pages_min(void); extern void setup_per_zone_wmarks(void);
extern void mem_init(void); extern void mem_init(void);
extern void __init mmap_init(void); extern void __init mmap_init(void);
extern void show_mem(void); extern void show_mem(void);
......
...@@ -422,7 +422,7 @@ int online_pages(unsigned long pfn, unsigned long nr_pages) ...@@ -422,7 +422,7 @@ int online_pages(unsigned long pfn, unsigned long nr_pages)
zone->present_pages += onlined_pages; zone->present_pages += onlined_pages;
zone->zone_pgdat->node_present_pages += onlined_pages; zone->zone_pgdat->node_present_pages += onlined_pages;
setup_per_zone_pages_min(); setup_per_zone_wmarks();
if (onlined_pages) { if (onlined_pages) {
kswapd_run(zone_to_nid(zone)); kswapd_run(zone_to_nid(zone));
node_set_state(zone_to_nid(zone), N_HIGH_MEMORY); node_set_state(zone_to_nid(zone), N_HIGH_MEMORY);
......
...@@ -4396,12 +4396,13 @@ static void setup_per_zone_lowmem_reserve(void) ...@@ -4396,12 +4396,13 @@ static void setup_per_zone_lowmem_reserve(void)
} }
/** /**
* setup_per_zone_pages_min - called when min_free_kbytes changes. * setup_per_zone_wmarks - called when min_free_kbytes changes
* or when memory is hot-added
* *
* Ensures that the pages_{min,low,high} values for each zone are set correctly * Ensures that the watermark[min,low,high] values for each zone are set
* with respect to min_free_kbytes. * correctly with respect to min_free_kbytes.
*/ */
void setup_per_zone_pages_min(void) void setup_per_zone_wmarks(void)
{ {
unsigned long pages_min = min_free_kbytes >> (PAGE_SHIFT - 10); unsigned long pages_min = min_free_kbytes >> (PAGE_SHIFT - 10);
unsigned long lowmem_pages = 0; unsigned long lowmem_pages = 0;
...@@ -4519,7 +4520,7 @@ static void __init setup_per_zone_inactive_ratio(void) ...@@ -4519,7 +4520,7 @@ static void __init setup_per_zone_inactive_ratio(void)
* 8192MB: 11584k * 8192MB: 11584k
* 16384MB: 16384k * 16384MB: 16384k
*/ */
static int __init init_per_zone_pages_min(void) static int __init init_per_zone_wmark_min(void)
{ {
unsigned long lowmem_kbytes; unsigned long lowmem_kbytes;
...@@ -4530,12 +4531,12 @@ static int __init init_per_zone_pages_min(void) ...@@ -4530,12 +4531,12 @@ static int __init init_per_zone_pages_min(void)
min_free_kbytes = 128; min_free_kbytes = 128;
if (min_free_kbytes > 65536) if (min_free_kbytes > 65536)
min_free_kbytes = 65536; min_free_kbytes = 65536;
setup_per_zone_pages_min(); setup_per_zone_wmarks();
setup_per_zone_lowmem_reserve(); setup_per_zone_lowmem_reserve();
setup_per_zone_inactive_ratio(); setup_per_zone_inactive_ratio();
return 0; return 0;
} }
module_init(init_per_zone_pages_min) module_init(init_per_zone_wmark_min)
/* /*
* min_free_kbytes_sysctl_handler - just a wrapper around proc_dointvec() so * 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,7 +4548,7 @@ int min_free_kbytes_sysctl_handler(ctl_table *table, int write,
{ {
proc_dointvec(table, write, file, buffer, length, ppos); proc_dointvec(table, write, file, buffer, length, ppos);
if (write) if (write)
setup_per_zone_pages_min(); setup_per_zone_wmarks();
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment