Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp390068ybx; Mon, 4 Nov 2019 22:24:11 -0800 (PST) X-Google-Smtp-Source: APXvYqw++cyz4xVy2KuJnpiYoht/ESApXP67IKqlkss6oZZYCx4+caSoXRVj0ik6x7iXAao0cNmf X-Received: by 2002:a50:bac2:: with SMTP id x60mr16226749ede.114.1572935051815; Mon, 04 Nov 2019 22:24:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572935051; cv=none; d=google.com; s=arc-20160816; b=WeMKHSE9FHZprmj/jR+hpBx0pGUh0OfogwoUKDtwynOlq4qn64Xd3pNEOszICsKOTK 5jPMygGs7NNh9zZ0DGsXm64XwZWRk5TxFWLgXJ4P39SfOlxVR0A/MGBYpUyZ+wT4w9zg wXYPBIvx7bO4+N7E8/3kq9gYql6mpdEMEbBb3QW2+T2o3vMB77QxHOv2gJ0CnZ3cWLgR jyxmwyQM6T5ULvE4PEyiMaaDLAHAtIJJ2wXcX19jxjG2ER6nWW/+ClDeGMQfMSIshcTB v3kTxGs/kGyQK29EQtZFA5wuReHewmPb1x0LGJ4bwHw9E0PtDZOzh7p/x9vkC9WFqzCd g2Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=GQqIup+vfNq0n5Z+IWj7FqwjBttDuCMRijxZFQTChtQ=; b=VfTJ4Zbna6xIne6JrhlyYnnVZvK8VGJ7fXlQhpVN8nxBpwFAXY7uxdFMPNjmPI10su AWQKahyIRRn8G+g3rdOFrP2WoBuztG03xgGh+IsRadHy5qANnbOvGI7NQnqYLkiYrOZY zqt5MgiyiSsHQnup6Y+mprYPd9ANtflWgMcjmGVp5lD0/Vk1p+l2vMxymNn8dv9QUKQL Tb987ym6foe8BRpNEwAnwtO6np2pwPjihTY5jD0+6u30ss/xbUW8rY7mbYfnkey5HEce QXCObpK9v65Um3rVczn50cq7w2IhgkRRF5nscNqOsy8dA/VLRRH8zBzDsvh2r/5Uy8x7 pmRw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ov6si8923866ejb.196.2019.11.04.22.23.47; Mon, 04 Nov 2019 22:24:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729714AbfKEGUZ (ORCPT + 99 others); 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