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.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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 81D49C47E49 for ; Mon, 4 Nov 2019 10:37:42 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 46DBC21D81 for ; Mon, 4 Nov 2019 10:37:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="PHLros9a" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 46DBC21D81 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C72B66B0005; Mon, 4 Nov 2019 05:37:41 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C242C6B0006; Mon, 4 Nov 2019 05:37:41 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B39AB6B0007; Mon, 4 Nov 2019 05:37:41 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0233.hostedemail.com [216.40.44.233]) by kanga.kvack.org (Postfix) with ESMTP id 9B7EC6B0005 for ; Mon, 4 Nov 2019 05:37:41 -0500 (EST) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id 3E15449961A for ; Mon, 4 Nov 2019 10:37:41 +0000 (UTC) X-FDA: 76118243922.04.crime59_7d22b2f36b812 X-HE-Tag: crime59_7d22b2f36b812 X-Filterd-Recvd-Size: 3466 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by imf26.hostedemail.com (Postfix) with ESMTP for ; Mon, 4 Nov 2019 10:37:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572863859; 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=PHLros9aZXJaZWiG3qjEBFNDL2kxgVzZ2CXwvq6+NNvtS0AvDRZtOX7mBgAnq0InhbRUaa qtdDLqiQN2gEagg+mnv5G9S3V3UTCOhEFAbyM/jFdbMhNgpQmJbXBsTmG4SntMw9SzKhgl nXg4LA93xNgT+faKze1GLC4Kbpvg8Ns= 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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