LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: "Roy Huang" <royhuang9@gmail.com>
Cc: linux-kernel@vger.kernel.org, aubreylee@gmail.com,
nickpiggin@yahoo.com.au, torvalds@osdl.org
Subject: Re: [PATCH] Provide an interface to limit total page cache.
Date: Thu, 18 Jan 2007 00:56:05 -0700 [thread overview]
Message-ID: <m1irf47oq2.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <afe668f90701150139q26e41720lf06d6ee445a917b0@mail.gmail.com> (Roy Huang's message of "Mon, 15 Jan 2007 17:39:46 +0800")
"Roy Huang" <royhuang9@gmail.com> writes:
> A patch provide a interface to limit total page cache in
> /proc/sys/vm/pagecache_ratio. The default value is 90 percent. Any
> feedback is appreciated.
Anything except a default value of 100% will change the behavior
and probably reduce the performance on most systems.
> -Roy
>
> diff -urp a/include/linux/sysctl.h b/include/linux/sysctl.h
> --- a/include/linux/sysctl.h 2007-01-15 17:18:46.000000000 +0800
> +++ b/include/linux/sysctl.h 2007-01-15 17:03:09.000000000 +0800
> @@ -202,6 +202,7 @@ enum
> VM_PANIC_ON_OOM=33, /* panic at out-of-memory */
> VM_VDSO_ENABLED=34, /* map VDSO into new processes? */
> VM_MIN_SLAB=35, /* Percent pages ignored by zone reclaim */
> + VM_PAGECACHE_RATIO=36, /* Percent memory is used as page cache */
> };
>
>
> diff -urp a/kernel/sysctl.c b/kernel/sysctl.c
> --- a/kernel/sysctl.c 2007-01-15 17:18:46.000000000 +0800
> +++ b/kernel/sysctl.c 2007-01-15 17:03:09.000000000 +0800
> @@ -1035,6 +1035,15 @@ static ctl_table vm_table[] = {
> .extra1 = &zero,
> },
> #endif
> + {
> + .ctl_name = VM_PAGECACHE_RATIO,
> + .procname = "pagecache_ratio",
> + .data = &pagecache_ratio,
> + .maxlen = sizeof(pagecache_ratio),
> + .mode = 0644,
> + .proc_handler = &pagecache_ratio_sysctl_handler,
> + .strategy = &sysctl_intvec,
> + },
> { .ctl_name = 0 }
> };
This is broken.
You have allocated a binary number for use with sys_sysctl but
did not test it.
If you need a special proc_handler to take action when the
value is changed you need a special strategy routine.
So since you aren't going to test the binary interface and don't
care about it please don't allocate a number for it and just
use CTL_UNNUMBERED.
And of course please read the top of linux/sysctl.h
Thank you.
Eric
next prev parent reply other threads:[~2007-01-18 7:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-15 9:39 Roy Huang
2007-01-15 11:01 ` Balbir Singh
2007-01-16 2:34 ` Roy Huang
2007-01-16 9:57 ` Balbir Singh
2007-01-15 11:57 ` Vaidyanathan Srinivasan
2007-01-16 2:40 ` Roy Huang
2007-01-17 14:55 ` Vaidyanathan Srinivasan
2007-01-18 7:56 ` Eric W. Biederman [this message]
2007-01-18 14:00 ` Pavel Machek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m1irf47oq2.fsf@ebiederm.dsl.xmission.com \
--to=ebiederm@xmission.com \
--cc=aubreylee@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nickpiggin@yahoo.com.au \
--cc=royhuang9@gmail.com \
--cc=torvalds@osdl.org \
--subject='Re: [PATCH] Provide an interface to limit total page cache.' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).