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=-2.4 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 EA194CA9ECF for ; Fri, 1 Nov 2019 19:24:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7821921734 for ; Fri, 1 Nov 2019 19:24:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chrisdown.name header.i=@chrisdown.name header.b="GpVrTIU9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7821921734 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chrisdown.name Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E902F6B0005; Fri, 1 Nov 2019 15:24:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E40606B0006; Fri, 1 Nov 2019 15:24:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D56936B0007; Fri, 1 Nov 2019 15:24:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0229.hostedemail.com [216.40.44.229]) by kanga.kvack.org (Postfix) with ESMTP id B44616B0005 for ; Fri, 1 Nov 2019 15:24:09 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id 3D979689A for ; Fri, 1 Nov 2019 19:24:09 +0000 (UTC) X-FDA: 76108684218.23.arm86_24306baaaab36 X-HE-Tag: arm86_24306baaaab36 X-Filterd-Recvd-Size: 4463 Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by imf33.hostedemail.com (Postfix) with ESMTP for ; Fri, 1 Nov 2019 19:24:08 +0000 (UTC) Received: by mail-wm1-f68.google.com with SMTP id v3so9343838wmh.1 for ; Fri, 01 Nov 2019 12:24:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chrisdown.name; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=1wEIO/2YiEoRoYoTOxS9UGohqBdoKl+fmZ2tHjySO14=; b=GpVrTIU9RaUx/M7L1qvoh0UVu6B13MdTGeuB+rZDPyyv9VjXHehuBDXTlap5rRupNp dDeV7/gWPljqzbZj29H07br6CXEpXan3xPKO0QhnYsbBM6m3gKaUZtOiDWjur++xSx3e oLZJ3uQrsc6oiP+ozeM76ZB3oKbMz7Ql7/y7Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=1wEIO/2YiEoRoYoTOxS9UGohqBdoKl+fmZ2tHjySO14=; b=DLiINpXsPO4IuZU3suEKD7crHVxMtEBV7v09AAlQNu3og7NnTUkn//Y41mOIxQkjfz UczW5ShYB4IhbIxVkxVnXospVCKV9NXHUSU5kwHJHYjbCdt1YP8UXzjxAZC/0KPHQyHp 6PqvlI0YsU1mXX6NdIZHO+lzhIwsGelZnRFXV1O1KxP2MKLdWJP/F1hNaf/aAR3S+Jpa 8/goQNBVRd8oU5DfcaLfhDmK/EXKDRThylN+T7SnEsHCF92KyNMSWztOHyibN/PE9oI1 LpnbSwUwbiKFqgG0L7obLbxMz0MbrMjw5cHY+jSQVEdOusG2+BYwky4sQvq2GE8wbc4f O97A== X-Gm-Message-State: APjAAAVJXn2H7k9XdRrTxHdCJJB30Y/EpSQX9huEU/HDnKbsupTc4PJn 4xf52tQ1orZnNEQuVr7mRgoX3Q== X-Google-Smtp-Source: APXvYqzhKELOJ9RzQ6qVqVkh8P/JQygqBphv8Nlt3tcnzxK6/UnOX5ZOkEBbTTEJb3+VnPupOp1Utw== X-Received: by 2002:a1c:6144:: with SMTP id v65mr11972251wmb.53.1572636247197; Fri, 01 Nov 2019 12:24:07 -0700 (PDT) Received: from localhost ([89.32.122.5]) by smtp.gmail.com with ESMTPSA id 11sm9025390wmb.34.2019.11.01.12.24.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2019 12:24:06 -0700 (PDT) Date: Fri, 1 Nov 2019 19:24:05 +0000 From: Chris Down To: Andrew Morton Cc: Johannes Weiner , 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: <20191101192405.GA866154@chrisdown.name> References: <20191031221602.9375-1-hannes@cmpxchg.org> <20191031162825.a545a5d4d8567368501769bd@linux-foundation.org> <20191101110901.GB690103@chrisdown.name> <20191101144540.GA12808@cmpxchg.org> <20191101115950.bb88d49849bfecb1af0a88bf@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20191101115950.bb88d49849bfecb1af0a88bf@linux-foundation.org> User-Agent: Mutt/1.12.2 (2019-09-21) 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: Andrew Morton writes: >> > The only scenario I can construct in my head is that someone has built >> > something to watch drop_caches for modification, but we already have the >> > kmsg output for that. > >The scenario is that something opens /proc/sys/vm/drop_caches for >reading, gets unexpected EPERM and blows up? Right, but... >OK. What if we make reads always return "0"? That will fix the >misleading output and is more backwards-compatible? ...I'm not convinced that if an application has no error boundary for that EPERM that it can tolerate a change in behaviour, either. I mean, if it's opening it at all, presumably it intends to do *something* based on the value (regardless of import or lack thereof). It may do nothing, but it's not possible to know whether that's better or worse than blowing up. I have mixed feelings on this one. Pragmatically, as someone who programs in userspace, I'd like failures based on changes in infrastructure to be loud, not silent. If I'm doing something which doesn't work, I'd like to know about it. Of course, one can make the argument that as a user of such an application, sometimes you don't have that luxury. Either change is an upgrade from the current situation, at least. I prefer towards whatever makes the API the least confusing, which appears to be Johannes' original change, but I'd support a patch which always set it to 0 instead if it was deemed safer.