From c6eb5d936163d7c70bf693a9ef9a2f39bd9c66d2 Mon Sep 17 00:00:00 2001 From: Andrea Righi Date: Thu, 30 Apr 2009 15:08:57 -0700 Subject: [PATCH] --- yaml --- r: 144375 b: refs/heads/master c: 9e4a5bda89034502fb144331e71a0efdfd5fae97 h: refs/heads/master i: 144373: 2e8275aa23028e719d5748b27a71239f560805ea 144371: 3f27fea5b8fb66c36b2907341e445a1d99cda342 144367: a054394c2592fa0d44a168b3af0c9a1352468cd9 v: v3 --- [refs] | 2 +- trunk/Documentation/sysctl/vm.txt | 4 ++++ trunk/kernel/sysctl.c | 5 ++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 19505befd30b..9517747664d1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 8713e01295140f674a41f2199b0f7ca99dfb69d5 +refs/heads/master: 9e4a5bda89034502fb144331e71a0efdfd5fae97 diff --git a/trunk/Documentation/sysctl/vm.txt b/trunk/Documentation/sysctl/vm.txt index 97c4b3284329..b716d33912d8 100644 --- a/trunk/Documentation/sysctl/vm.txt +++ b/trunk/Documentation/sysctl/vm.txt @@ -90,6 +90,10 @@ will itself start writeback. If dirty_bytes is written, dirty_ratio becomes a function of its value (dirty_bytes / the amount of dirtyable system memory). +Note: the minimum value allowed for dirty_bytes is two pages (in bytes); any +value lower than this limit will be ignored and the old configuration will be +retained. + ============================================================== dirty_expire_centisecs diff --git a/trunk/kernel/sysctl.c b/trunk/kernel/sysctl.c index e3d2c7dd59b9..ea78fa101ad6 100644 --- a/trunk/kernel/sysctl.c +++ b/trunk/kernel/sysctl.c @@ -103,6 +103,9 @@ static unsigned long one_ul = 1; static int one_hundred = 100; static int one_thousand = 1000; +/* this is needed for the proc_doulongvec_minmax of vm_dirty_bytes */ +static unsigned long dirty_bytes_min = 2 * PAGE_SIZE; + /* this is needed for the proc_dointvec_minmax for [fs_]overflow UID and GID */ static int maxolduid = 65535; static int minolduid; @@ -1006,7 +1009,7 @@ static struct ctl_table vm_table[] = { .mode = 0644, .proc_handler = &dirty_bytes_handler, .strategy = &sysctl_intvec, - .extra1 = &one_ul, + .extra1 = &dirty_bytes_min, }, { .procname = "dirty_writeback_centisecs",