* [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
* [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
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [RFC PATCH] Add Kconfig option for default swappiness
2010-10-31 18:08 ` Ben Gamari
@ 2010-11-01 12:43 ` Johannes Weiner
-1 siblings, 0 replies; 14+ messages in thread
From: Johannes Weiner @ 2010-11-01 12:43 UTC (permalink / raw)
To: Ben Gamari; +Cc: KAMEZAWA Hiroyuki, linux-mm, linux-kernel
On Sun, Oct 31, 2010 at 02:08:28PM -0400, Ben Gamari wrote:
> This will allow distributions to tune this important vm parameter in a more
> self-contained manner.
What's wrong with sticking
vm.swappiness = <your value>
into the shipped /etc/sysctl.conf?
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [RFC PATCH] Add Kconfig option for default swappiness
@ 2010-11-01 12:43 ` Johannes Weiner
0 siblings, 0 replies; 14+ messages in thread
From: Johannes Weiner @ 2010-11-01 12:43 UTC (permalink / raw)
To: Ben Gamari; +Cc: KAMEZAWA Hiroyuki, linux-mm, linux-kernel
On Sun, Oct 31, 2010 at 02:08:28PM -0400, Ben Gamari wrote:
> This will allow distributions to tune this important vm parameter in a more
> self-contained manner.
What's wrong with sticking
vm.swappiness = <your value>
into the shipped /etc/sysctl.conf?
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [RFC PATCH] Add Kconfig option for default swappiness
2010-11-01 12:43 ` Johannes Weiner
@ 2010-11-01 12:52 ` Ben Gamari
-1 siblings, 0 replies; 14+ messages in thread
From: Ben Gamari @ 2010-11-01 12:52 UTC (permalink / raw)
To: Johannes Weiner; +Cc: KAMEZAWA Hiroyuki, linux-mm, linux-kernel
On Mon, 1 Nov 2010 08:43:22 -0400, Johannes Weiner <hannes@cmpxchg.org> wrote:
> On Sun, Oct 31, 2010 at 02:08:28PM -0400, Ben Gamari wrote:
> > This will allow distributions to tune this important vm parameter in a more
> > self-contained manner.
>
> What's wrong with sticking
>
> vm.swappiness = <your value>
>
> into the shipped /etc/sysctl.conf?
Ubuntu ships different kernels for desktop and server usage. From a
packaging standpoint it would be much nicer to have this set in the
kernel configuration. If we were to throw the setting /etc/sysctl.conf
the kernel would depend upon the package containing sysctl(8)
(procps). We'd rather avoid this and keep the default kernel
configuration in one place. This was just an RFC though; let me know if
you think this is totally insane.
- Ben
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [RFC PATCH] Add Kconfig option for default swappiness
@ 2010-11-01 12:52 ` Ben Gamari
0 siblings, 0 replies; 14+ messages in thread
From: Ben Gamari @ 2010-11-01 12:52 UTC (permalink / raw)
To: Johannes Weiner; +Cc: KAMEZAWA Hiroyuki, linux-mm, linux-kernel
On Mon, 1 Nov 2010 08:43:22 -0400, Johannes Weiner <hannes@cmpxchg.org> wrote:
> On Sun, Oct 31, 2010 at 02:08:28PM -0400, Ben Gamari wrote:
> > This will allow distributions to tune this important vm parameter in a more
> > self-contained manner.
>
> What's wrong with sticking
>
> vm.swappiness = <your value>
>
> into the shipped /etc/sysctl.conf?
Ubuntu ships different kernels for desktop and server usage. From a
packaging standpoint it would be much nicer to have this set in the
kernel configuration. If we were to throw the setting /etc/sysctl.conf
the kernel would depend upon the package containing sysctl(8)
(procps). We'd rather avoid this and keep the default kernel
configuration in one place. This was just an RFC though; let me know if
you think this is totally insane.
- Ben
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [RFC PATCH] Add Kconfig option for default swappiness
2010-10-31 18:08 ` Ben Gamari
@ 2010-11-01 20:09 ` Jesper Juhl
-1 siblings, 0 replies; 14+ messages in thread
From: Jesper Juhl @ 2010-11-01 20:09 UTC (permalink / raw)
To: Ben Gamari; +Cc: KAMEZAWA Hiroyuki, linux-mm, linux-kernel
On Sun, 31 Oct 2010, Ben Gamari wrote:
> 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.
> +
Perhaps this help text should mention the fact that swapiness setting can
be changed at runtime (regardless of the set default) by writing to
/proc/sys/vm/swappiness ???
--
Jesper Juhl <jj@chaosbits.net> http://www.chaosbits.net/
Plain text mails only, please http://www.expita.com/nomime.html
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [RFC PATCH] Add Kconfig option for default swappiness
@ 2010-11-01 20:09 ` Jesper Juhl
0 siblings, 0 replies; 14+ messages in thread
From: Jesper Juhl @ 2010-11-01 20:09 UTC (permalink / raw)
To: Ben Gamari; +Cc: KAMEZAWA Hiroyuki, linux-mm, linux-kernel
On Sun, 31 Oct 2010, Ben Gamari wrote:
> 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.
> +
Perhaps this help text should mention the fact that swapiness setting can
be changed at runtime (regardless of the set default) by writing to
/proc/sys/vm/swappiness ???
--
Jesper Juhl <jj@chaosbits.net> http://www.chaosbits.net/
Plain text mails only, please http://www.expita.com/nomime.html
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [RFC PATCH] Add Kconfig option for default swappiness
2010-11-01 12:52 ` Ben Gamari
@ 2010-11-01 20:14 ` Johannes Weiner
-1 siblings, 0 replies; 14+ messages in thread
From: Johannes Weiner @ 2010-11-01 20:14 UTC (permalink / raw)
To: Ben Gamari; +Cc: KAMEZAWA Hiroyuki, linux-mm, linux-kernel
On Mon, Nov 01, 2010 at 08:52:30AM -0400, Ben Gamari wrote:
> On Mon, 1 Nov 2010 08:43:22 -0400, Johannes Weiner <hannes@cmpxchg.org> wrote:
> > On Sun, Oct 31, 2010 at 02:08:28PM -0400, Ben Gamari wrote:
> > > This will allow distributions to tune this important vm parameter in a more
> > > self-contained manner.
> >
> > What's wrong with sticking
> >
> > vm.swappiness = <your value>
> >
> > into the shipped /etc/sysctl.conf?
>
> Ubuntu ships different kernels for desktop and server usage. From a
> packaging standpoint it would be much nicer to have this set in the
> kernel configuration. If we were to throw the setting /etc/sysctl.conf
> the kernel would depend upon the package containing sysctl(8)
> (procps). We'd rather avoid this and keep the default kernel
> configuration in one place.
Fair point. Feel free to add my
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [RFC PATCH] Add Kconfig option for default swappiness
@ 2010-11-01 20:14 ` Johannes Weiner
0 siblings, 0 replies; 14+ messages in thread
From: Johannes Weiner @ 2010-11-01 20:14 UTC (permalink / raw)
To: Ben Gamari; +Cc: KAMEZAWA Hiroyuki, linux-mm, linux-kernel
On Mon, Nov 01, 2010 at 08:52:30AM -0400, Ben Gamari wrote:
> On Mon, 1 Nov 2010 08:43:22 -0400, Johannes Weiner <hannes@cmpxchg.org> wrote:
> > On Sun, Oct 31, 2010 at 02:08:28PM -0400, Ben Gamari wrote:
> > > This will allow distributions to tune this important vm parameter in a more
> > > self-contained manner.
> >
> > What's wrong with sticking
> >
> > vm.swappiness = <your value>
> >
> > into the shipped /etc/sysctl.conf?
>
> Ubuntu ships different kernels for desktop and server usage. From a
> packaging standpoint it would be much nicer to have this set in the
> kernel configuration. If we were to throw the setting /etc/sysctl.conf
> the kernel would depend upon the package containing sysctl(8)
> (procps). We'd rather avoid this and keep the default kernel
> configuration in one place.
Fair point. Feel free to add my
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [RFC PATCH] Add Kconfig option for default swappiness
2010-11-01 20:09 ` Jesper Juhl
@ 2010-11-01 20:41 ` Ben Gamari
-1 siblings, 0 replies; 14+ messages in thread
From: Ben Gamari @ 2010-11-01 20:41 UTC (permalink / raw)
To: Jesper Juhl; +Cc: KAMEZAWA Hiroyuki, linux-mm, linux-kernel
On Mon, 1 Nov 2010 21:09:58 +0100 (CET), Jesper Juhl <jj@chaosbits.net> wrote:
> Perhaps this help text should mention the fact that swapiness setting can
> be changed at runtime (regardless of the set default) by writing to
> /proc/sys/vm/swappiness ???
>
This definitely wouldn't hurt. I'll respin with updated help text.
- Ben
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [RFC PATCH] Add Kconfig option for default swappiness
@ 2010-11-01 20:41 ` Ben Gamari
0 siblings, 0 replies; 14+ messages in thread
From: Ben Gamari @ 2010-11-01 20:41 UTC (permalink / raw)
To: Jesper Juhl; +Cc: KAMEZAWA Hiroyuki, linux-mm, linux-kernel
On Mon, 1 Nov 2010 21:09:58 +0100 (CET), Jesper Juhl <jj@chaosbits.net> wrote:
> Perhaps this help text should mention the fact that swapiness setting can
> be changed at runtime (regardless of the set default) by writing to
> /proc/sys/vm/swappiness ???
>
This definitely wouldn't hurt. I'll respin with updated help text.
- Ben
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [RFC PATCH] Add Kconfig option for default swappiness
2010-11-01 20:41 ` Ben Gamari
@ 2010-11-02 1:04 ` Wu Fengguang
-1 siblings, 0 replies; 14+ messages in thread
From: Wu Fengguang @ 2010-11-02 1:04 UTC (permalink / raw)
To: Ben Gamari; +Cc: Jesper Juhl, KAMEZAWA Hiroyuki, linux-mm, linux-kernel
On Mon, Nov 01, 2010 at 04:41:35PM -0400, Ben Gamari wrote:
> On Mon, 1 Nov 2010 21:09:58 +0100 (CET), Jesper Juhl <jj@chaosbits.net> wrote:
> > Perhaps this help text should mention the fact that swapiness setting can
> > be changed at runtime (regardless of the set default) by writing to
> > /proc/sys/vm/swappiness ???
> >
> This definitely wouldn't hurt. I'll respin with updated help text.
Acked-by: Wu Fengguang <fengguang.wu@intel.com>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [RFC PATCH] Add Kconfig option for default swappiness
@ 2010-11-02 1:04 ` Wu Fengguang
0 siblings, 0 replies; 14+ messages in thread
From: Wu Fengguang @ 2010-11-02 1:04 UTC (permalink / raw)
To: Ben Gamari; +Cc: Jesper Juhl, KAMEZAWA Hiroyuki, linux-mm, linux-kernel
On Mon, Nov 01, 2010 at 04:41:35PM -0400, Ben Gamari wrote:
> On Mon, 1 Nov 2010 21:09:58 +0100 (CET), Jesper Juhl <jj@chaosbits.net> wrote:
> > Perhaps this help text should mention the fact that swapiness setting can
> > be changed at runtime (regardless of the set default) by writing to
> > /proc/sys/vm/swappiness ???
> >
> This definitely wouldn't hurt. I'll respin with updated help text.
Acked-by: Wu Fengguang <fengguang.wu@intel.com>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [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.