All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH] Add Kconfig option for default swappiness
@ 2010-10-31 18:08 ` Ben Gamari
  0 siblings, 0 replies; 14+ messages in thread
From: Ben Gamari @ 2010-10-31 18:08 UTC (permalink / raw)
  To: KAMEZAWA Hiroyuki, linux-mm, linux-kernel; +Cc: Ben Gamari

This will allow distributions to tune this important vm parameter in a more
self-contained manner.

Signed-off-by: Ben Gamari <bgamari.foss@gmail.com>
---
 Documentation/sysctl/vm.txt |    2 +-
 mm/Kconfig                  |   11 +++++++++++
 mm/vmscan.c                 |    2 +-
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/Documentation/sysctl/vm.txt b/Documentation/sysctl/vm.txt
index 6c7d18c..792823b 100644
--- a/Documentation/sysctl/vm.txt
+++ b/Documentation/sysctl/vm.txt
@@ -614,7 +614,7 @@ This control is used to define how aggressive the kernel will swap
 memory pages.  Higher values will increase agressiveness, lower values
 decrease the amount of swap.
 
-The default value is 60.
+The default value is 60 (changed with CONFIG_DEFAULT_SWAPINESS).
 
 ==============================================================
 
diff --git a/mm/Kconfig b/mm/Kconfig
index 9c61158..729ecec 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -61,6 +61,17 @@ config SPARSEMEM_MANUAL
 
 endchoice
 
+config DEFAULT_SWAPPINESS
+	int "Default swappiness"
+	default "60"
+	range 0 100
+	help
+	  This control is used to define how aggressive the kernel will swap
+	  memory pages.  Higher values will increase agressiveness, lower
+	  values decrease the amount of swap. Valid values range from 0 to 100.
+
+	  If unsure, keep default value of 60.
+
 config DISCONTIGMEM
 	def_bool y
 	depends on (!SELECT_MEMORY_MODEL && ARCH_DISCONTIGMEM_ENABLE) || DISCONTIGMEM_MANUAL
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 3ff3311..342975f 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -126,7 +126,7 @@ struct scan_control {
 /*
  * From 0 .. 100.  Higher means more swappy.
  */
-int vm_swappiness = 60;
+int vm_swappiness = CONFIG_DEFAULT_SWAPPINESS;
 long vm_total_pages;	/* The total number of pages which the VM controls */
 
 static LIST_HEAD(shrinker_list);
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2010-11-02  1:06 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-31 18:08 [RFC PATCH] Add Kconfig option for default swappiness Ben Gamari
2010-10-31 18:08 ` Ben Gamari
2010-11-01 12:43 ` Johannes Weiner
2010-11-01 12:43   ` Johannes Weiner
2010-11-01 12:52   ` Ben Gamari
2010-11-01 12:52     ` Ben Gamari
2010-11-01 20:14     ` Johannes Weiner
2010-11-01 20:14       ` Johannes Weiner
2010-11-01 20:09 ` Jesper Juhl
2010-11-01 20:09   ` Jesper Juhl
2010-11-01 20:41   ` Ben Gamari
2010-11-01 20:41     ` Ben Gamari
2010-11-02  1:04     ` Wu Fengguang
2010-11-02  1:04       ` Wu Fengguang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.