linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kernel: sysctl: make drop_caches write-only
@ 2019-10-31 22:16 Johannes Weiner
  2019-10-31 23:28 ` Andrew Morton
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Johannes Weiner @ 2019-10-31 22:16 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-mm, linux-kernel, kernel-team

Currently, the drop_caches proc file and sysctl read back the last
value written, suggesting this is somehow a stateful setting instead
of a one-time command. Make it write-only, like e.g. compact_memory.

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
---
 kernel/sysctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 31ece1120aa4..50373984a5e2 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -1474,7 +1474,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,
 		.extra1		= SYSCTL_ONE,
 		.extra2		= &four,
-- 
2.23.0



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

end of thread, other threads:[~2019-11-05  6:20 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-31 22:16 [PATCH] kernel: sysctl: make drop_caches write-only Johannes Weiner
2019-10-31 23:28 ` Andrew Morton
2019-11-01 11:09   ` Chris Down
2019-11-01 11:09     ` Chris Down
2019-11-01 14:45     ` Johannes Weiner
2019-11-01 18:59       ` Andrew Morton
2019-11-01 19:24         ` Chris Down
2019-11-01 19:29           ` Andrew Morton
2019-11-01 19:35             ` Andrew Morton
2019-11-02 15:55               ` Alexey Dobriyan
2019-11-03 19:00                 ` Eric W. Biederman
2019-11-01 10:58 ` Chris Down
2019-11-04 10:37 ` David Hildenbrand
2019-11-04 13:25 ` Vlastimil Babka
2019-11-05  6:20 ` Michal Hocko

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).