]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
mm-add-extra-free-kbytes-tunable-update
authorRik van Riel <riel@redhat.com>
Wed, 16 Nov 2011 23:41:24 +0000 (10:41 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 17 Nov 2011 02:57:09 +0000 (13:57 +1100)
All the fixes suggested by Andrew Morton.   Not much of a changelog
since the patch should probably be folded into
mm-add-extra-free-kbytes-tunable.patch

Thank you for pointing these out, Andrew.

Signed-off-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/mmzone.h
include/linux/swap.h
kernel/sysctl.c
mm/page_alloc.c

index 188cb2ffe8db2685a5b1b50e584026a1ffcfd9f6..1bc9e1b6f46441c4525c2996be681ae8925a8315 100644 (file)
@@ -785,7 +785,7 @@ static inline int is_dma(struct zone *zone)
 
 /* These two functions are used to setup the per zone pages min values */
 struct ctl_table;
-int min_free_kbytes_sysctl_handler(struct ctl_table *, int,
+int free_kbytes_sysctl_handler(struct ctl_table *, int,
                                        void __user *, size_t *, loff_t *);
 extern int sysctl_lowmem_reserve_ratio[MAX_NR_ZONES-1];
 int lowmem_reserve_ratio_sysctl_handler(struct ctl_table *, int,
index 537102d32210c3cc3296419bd5e6bc693c1a97cf..d782d045a9d99e9e7517805ee013a0408aff9d64 100644 (file)
@@ -211,6 +211,8 @@ struct swap_list_t {
 /* linux/mm/page_alloc.c */
 extern unsigned long totalram_pages;
 extern unsigned long totalreserve_pages;
+extern int min_free_kbytes;
+extern int extra_free_kbytes;
 extern unsigned int nr_free_buffer_pages(void);
 extern unsigned int nr_free_pagecache_pages(void);
 
index 5f50eab55d1b472a7fe07e6470ae2b1091750987..39e5f71b20ff1277ef418b0849d66a70841b5e16 100644 (file)
@@ -96,8 +96,6 @@ extern int suid_dumpable;
 extern char core_pattern[];
 extern unsigned int core_pipe_limit;
 extern int pid_max;
-extern int min_free_kbytes;
-extern int extra_free_kbytes;
 extern int pid_max_min, pid_max_max;
 extern int sysctl_drop_caches;
 extern int percpu_pagelist_fraction;
@@ -1197,7 +1195,7 @@ static struct ctl_table vm_table[] = {
                .data           = &min_free_kbytes,
                .maxlen         = sizeof(min_free_kbytes),
                .mode           = 0644,
-               .proc_handler   = min_free_kbytes_sysctl_handler,
+               .proc_handler   = free_kbytes_sysctl_handler,
                .extra1         = &zero,
        },
        {
@@ -1205,7 +1203,7 @@ static struct ctl_table vm_table[] = {
                .data           = &extra_free_kbytes,
                .maxlen         = sizeof(extra_free_kbytes),
                .mode           = 0644,
-               .proc_handler   = min_free_kbytes_sysctl_handler,
+               .proc_handler   = free_kbytes_sysctl_handler,
                .extra1         = &zero,
        },
        {
index ad0ce2e75a227fa80c81a3cb35dcd5818a9cf828..62dc49bae2256ce1b7802c55284514b03695813b 100644 (file)
@@ -183,11 +183,12 @@ static char * const zone_names[MAX_NR_ZONES] = {
 int min_free_kbytes = 1024;
 
 /*
- * Extra memory for the system to try freeing. Used to temporarily
- * free memory, to make space for new workloads. Anyone can allocate
- * down to the min watermarks controlled by min_free_kbytes above.
+ * Extra memory for the system to try freeing between the min and
+ * low watermarks.  Useful for workloads that require low latency
+ * memory allocations in bursts larger than the normal gap between
+ * low and min.
  */
-int extra_free_kbytes = 0;
+int extra_free_kbytes;
 
 static unsigned long __meminitdata nr_kernel_pages;
 static unsigned long __meminitdata nr_all_pages;
@@ -5290,11 +5291,11 @@ int __meminit init_per_zone_wmark_min(void)
 module_init(init_per_zone_wmark_min)
 
 /*
- * min_free_kbytes_sysctl_handler - just a wrapper around proc_dointvec() so 
+ * free_kbytes_sysctl_handler - just a wrapper around proc_dointvec() so 
  *     that we can call two helper functions whenever min_free_kbytes
  *     or extra_free_kbytes changes.
  */
-int min_free_kbytes_sysctl_handler(ctl_table *table, int write, 
+int free_kbytes_sysctl_handler(ctl_table *table, int write, 
        void __user *buffer, size_t *length, loff_t *ppos)
 {
        proc_dointvec(table, write, buffer, length, ppos);