Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp945576ybx; Fri, 1 Nov 2019 13:58:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqy/6m1e1KFVQlit49Q0d4AeaJ10nKFzoDlTPiC8R206QquyNVyq652JDsm177P7SxO/UNlT X-Received: by 2002:aa7:cd5b:: with SMTP id v27mr15266422edw.174.1572641917188; Fri, 01 Nov 2019 13:58:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572641917; cv=none; d=google.com; s=arc-20160816; b=l+rMHtx7sLsgbSc6H6FNKhTTikRBptvpQS0iNgrnsZNgxLyw8QPheP2M0LmVbMnmhy 2GL+Z7RQBrKQgWwjRSwBfpnbuzMFh8qjKQik7T3atFWmQhNUUsUQN8LDFny1thSzUcRV w45ghbv4XjIklPxqHWgQo28oPtChf3IcwcTZs4BwO7nJioemeUpdbRGZ2JrbXMQI1BmV SmbCgruwH+9IP4O8n9/h/zZnobJ1Pj0t5V20eQFmytuUO9OvqsZ7FaPyDW+g2xsD7nNI mMFzUU90tiW5MLUpx74zzYOif6xV6hswCqhE88QNTso+zHGDhVU5CBBmbh74rMRoagB9 +pSw== 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:dkim-signature; bh=1wEIO/2YiEoRoYoTOxS9UGohqBdoKl+fmZ2tHjySO14=; b=IOAfoQFGX9UKh2wDkURLRPf8uVzBwy49v+kTPW1R6s3IaEHX1jNsxbmgnshLZXCpfg G4eV9mZ8vv0Jp0VOwYpkNb/WZZqmkDPfYEbauNCJsnYYOPFIqDMRPg4AWvyZksQul2l2 Cqpa/pABBrTKTirF7qxgesj5ACQFiWCbEo96YoGf/3ETtXaMOYfUEbHzItDeNTeFiFqH 40UOBDjAkIDetxhN4AyQgIaSQSU/gNFKYcVMIu68OstUL5nNnS3U8AJ2Gj1LzM7Oh7YQ CzQqIBf9/G9qUofSp+GzI+HK0GsnjKxnN9MQwo1LIvs+yhMURPao2MFK4MLNBO7ALHyg DtTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chrisdown.name header.s=google header.b=GpVrTIU9; 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=chrisdown.name Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 26si6802411ejx.60.2019.11.01.13.58.14; Fri, 01 Nov 2019 13:58:37 -0700 (PDT) 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=@chrisdown.name header.s=google header.b=GpVrTIU9; 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=chrisdown.name Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727715AbfKATYL (ORCPT + 99 others); Fri, 1 Nov 2019 15:24:11 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:34926 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727659AbfKATYL (ORCPT ); Fri, 1 Nov 2019 15:24:11 -0400 Received: by mail-wm1-f65.google.com with SMTP id 8so2972420wmo.0 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=bLy8aba4QvHLz4u8oEXfIP2l3QKQLyzITIas/ADO3U1cxQGy5W08djPLwiLbZP2dBf vhSHmXuJwo+i3C3jz/tm0oVNUSGX9DikCs7OusHXQpya9M59JKO+nQPnHXehf489xmto UFXM0Z3ud5kbgYZkLUwcu5cPJ1UuLdGWqmezGGP5M+ul6cqdi8xVKNSf1idr3jUt11Sb 81h6MwO1x/Jq85V+PKuAQvLDDgIlW9N2YoXWavZAe5Rd4B1crop4Kz27SIUHXw67LXud cucTeHEDF5j5Oqb113KlE0xmPp+D0LKl5YfU4jogxpLX73ELUHejj51nM+k3Wsi3RgMK F7/Q== X-Gm-Message-State: APjAAAVxCkpLbus+U+/t8QJmMTg9Ij5RaSjtQtehaDJALrw+A2GMhHvX otMHbr7VX+NrijG9J7IAzF0ZyFOJVV2qtQ== 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) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.