From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 480F1CA9EC7 for ; Tue, 5 Nov 2019 06:20:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 127AA206BA for ; Tue, 5 Nov 2019 06:20:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572934826; bh=M2RIab8IaYn1K4OAEekroW7nbIexXbC42kfoV4dVPEY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=M+20BopipDXx0PB5pNS9ldCv2vGruhdBwWRdGO2kECR4I6SjKed4b2Ze4C/ckMuox NfpjsrCg+LY2il3cFKB71jT/X/JhuH7xNZdtERVldxPDUGn7boA/Cs4Fj24CsssVbU BWdtle2lnmntocJgVHndaDNXqrp6myx65NCIk6+8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730423AbfKEGUZ (ORCPT ); Tue, 5 Nov 2019 01:20:25 -0500 Received: from mx2.suse.de ([195.135.220.15]:42092 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725806AbfKEGUY (ORCPT ); Tue, 5 Nov 2019 01:20:24 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 39F60B023; Tue, 5 Nov 2019 06:20:23 +0000 (UTC) Date: Tue, 5 Nov 2019 07:20:22 +0100 From: Michal Hocko To: Johannes Weiner Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH] kernel: sysctl: make drop_caches write-only Message-ID: <20191105062022.GB22672@dhcp22.suse.cz> References: <20191031221602.9375-1-hannes@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191031221602.9375-1-hannes@cmpxchg.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 31-10-19 18:16:02, Johannes Weiner wrote: > 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 Please add a note about the confusion this has caused already. The link posted by Chris would be useful as well. Acked-by: Michal Hocko > --- > 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 -- Michal Hocko SUSE Labs