Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp3772844ybx; Mon, 4 Nov 2019 02:39:58 -0800 (PST) X-Google-Smtp-Source: APXvYqyIrmVWCrSUi7e2LczupaRp039SrOoSphVo42pLI4k94MRoLtTz3ZUG1wyrDoQTK1Oh8ywf X-Received: by 2002:a17:906:4bcb:: with SMTP id x11mr23588583ejv.9.1572863998660; Mon, 04 Nov 2019 02:39:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572863998; cv=none; d=google.com; s=arc-20160816; b=yzrfvIW3XcNF/3jUJ0TELCT70498J91i7Nrcr52Yc/WhAw79a38hjNjDHrO6HvUGjn 5N5ohdsNh5Zw+DO6rXwlF9LXoSVA98MIzY5f75xBaShHHBpLfTEmBpRJhNmQWfx9o/Sr d693sa9UohGJU1lKnKPi0cBzuh8+HLXbecBVY6w5fgWx8yH01mvH8GWpV6rR7eVmxd9X BV7ovWRphHw81SePJ6I/O5bqPyD+wwhLjyldlj4Qb7xfs0BuLrlGeXr0RteQRA81ubgB /KHihOl8DpCXd7GO8dX6XFWUHQdkRZ8paNJz8XEDoox9sOyS9gUpe2OMPbZT3Y2h9VAh SQQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :dkim-signature; bh=MMXyGR7I3i/vhgf/dekFdcU/0hdNU18RC/twvaKN7SI=; b=GkeJ3QPNrtGaW8nw2O9gUcfYy26BzExZyLkvi9uD1f2RfiecphjU5IrnpCsNDYABsf 38ZRqw0tuNcX/LJL9dKWHm3bwbkqDrqxPeCe1KaEmWaBBto+uRp9CGRgZE2cCU1p9NQm LNhnORqhp5iItDjesTto8GryA+r6IY8chwFAUREVl0g3P6BXVmQcvLfkSajIF9ytnPOP Db8YI7mWYA3RIexfkOKQw0IaZkBQUuC+U3zbg5i72K+B/2Wyg5SW58hiEvpEj03DKExF AEoe9c/WiZHRi5KLqBTkfdw50KcptSu4QIo9DEy2AbRDk68iFsNmz/ykBFbtcLwL8ZnN CfWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NAs8NYST; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q5si2177725ejz.344.2019.11.04.02.39.34; Mon, 04 Nov 2019 02:39:58 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NAs8NYST; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728355AbfKDKhm (ORCPT + 99 others); Mon, 4 Nov 2019 05:37:42 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:43009 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726441AbfKDKhl (ORCPT ); Mon, 4 Nov 2019 05:37:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572863860; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MMXyGR7I3i/vhgf/dekFdcU/0hdNU18RC/twvaKN7SI=; b=NAs8NYSTg1BFoE8Ey/SN3T5a7mBCju2FzoFOKDIAY433UAyQjkB0bfNblFewI1bU4SEHZW fr/DBAnppHxYSaBKfumDCn9zC+/NhVAOKdDM5Ixj5iLfoOS348QgKsus9GMGeTsj/zpoMn NNOwtngrX/Qq0IaJcfz9HU960BD6dsY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-307-Xv08RWICP4GRgnKWVX-6qA-1; Mon, 04 Nov 2019 05:37:37 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 934198017DD; Mon, 4 Nov 2019 10:37:36 +0000 (UTC) Received: from [10.36.118.62] (unknown [10.36.118.62]) by smtp.corp.redhat.com (Postfix) with ESMTP id 546C519C4F; Mon, 4 Nov 2019 10:37:35 +0000 (UTC) Subject: Re: [PATCH] kernel: sysctl: make drop_caches write-only To: Johannes Weiner , Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@fb.com References: <20191031221602.9375-1-hannes@cmpxchg.org> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: <39ae67e9-fc2b-5c85-63a2-a149cd99b0b3@redhat.com> Date: Mon, 4 Nov 2019 11:37:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 In-Reply-To: <20191031221602.9375-1-hannes@cmpxchg.org> Content-Language: en-US X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: Xv08RWICP4GRgnKWVX-6qA-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 31.10.19 23:16, 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. >=20 > Signed-off-by: Johannes Weiner > --- > kernel/sysctl.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > 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[] =3D { > =09=09.procname=09=3D "drop_caches", > =09=09.data=09=09=3D &sysctl_drop_caches, > =09=09.maxlen=09=09=3D sizeof(int), > -=09=09.mode=09=09=3D 0644, > +=09=09.mode=09=09=3D 0200, > =09=09.proc_handler=09=3D drop_caches_sysctl_handler, > =09=09.extra1=09=09=3D SYSCTL_ONE, > =09=09.extra2=09=09=3D &four, >=20 Makes perfect sense to me (and we might notice while in next/master if=20 this breaks something, hopefully) Acked-by: David Hildenbrand --=20 Thanks, David / dhildenb