mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: crquan@gmail.com
To: Mel Gorman <mel@csn.ul.ie>, akpm@linux-foundation.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] sysctl: change vm.drop_caches perm to 0200 to avoid misleading
Date: Thu,  9 Sep 2010 02:17:46 +0800	[thread overview]
Message-ID: <1283969866-4960-1-git-send-email-crquan@gmail.com> (raw)

From: Cheng Renquan <crquan@gmail.com>

The original vm.drop_caches perm is 0644 that allows users to read
its current value, that is quite misleading, I read articles often
on that topic teaching people how to see its current value, and how
to change its value to 3; that would make readers to misunderstand
that varaiable works like a long time state variable, and have long
time effect after writing its value to 3:
http://www.penglixun.com/tech/system/manual_free_linux_memory.html

In fact, this value is for debugging purpose only, and only effect
while writing, means during writing its value to 3, the kernel would
reclaim pagecache and slabcache memory explicitly, it works for only
one time; so only its write permission is meaningful, reading that
var's current value is meaningless and quite misleading, and the best
way to stop misleading is to mark it as write only;

Signed-off-by: Cheng Renquan <crquan@gmail.com>
---
 kernel/sysctl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index ca38e8e..0e37e89 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -1126,7 +1126,7 @@ static struct ctl_table vm_table[] = {
 		.procname	= "drop_caches",
 		.data		= &sysctl_drop_caches,
 		.maxlen		= sizeof(int),
-		.mode		= 0644,
+		.mode		= 0200,
 		.proc_handler	= drop_caches_sysctl_handler,
 	},
 #ifdef CONFIG_COMPACTION
-- 
1.7.0.4


                 reply	other threads:[~2010-09-08 18:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1283969866-4960-1-git-send-email-crquan@gmail.com \
    --to=crquan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mel@csn.ul.ie \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®