Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp867528ybx; Fri, 1 Nov 2019 12:33:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqy/wNXgspUm+/pz5B23ktzo2/6KCcv1eK7ACmLi2f15HByamwkpT95JITZdmBJTBvlhVNQJ X-Received: by 2002:a05:6402:17ec:: with SMTP id t12mr14874335edy.37.1572636782131; Fri, 01 Nov 2019 12:33:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572636782; cv=none; d=google.com; s=arc-20160816; b=niLSXWMvPkg64i6J5XIIKBdKG3dMI2pPSlrqNR+mwIW/uoW1b1sMaAKRt3oGEb4CPE HS6XUb2i0isBzSV+cyVA3Q2B1zIRzVUcaEXCj90oTxnyemHZ7mLgkQW6kLdvUwhu+XTM 9whku9BbsITzjfBLyAiLggoydH0ZBCd7AKCJis4Ng8vUs/R85sgseUF5wzn5exrSkQGo 0XLvoRvCkjuXF4s/aHyGu9RTfKFYpO0C8YZ28I1V2uH4BIDNsYwp3aTLBJ7epUu4+NRU ia1ncrWQX6sw0XGG00wBfhAdVWZdKjuBmqxOEUu4GEoH0JZFIGNZ/SjBivtm8mT1UQdr UnzA== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=m0wV3q6ZE0wdjnfckJq03kosABe0yvKe4/J9e9MUD+c=; b=hiAudgh2Po3FPg8LmtjF5rf31F81laH5jLDe5yRJnNXeQLX2mMOGC5NB3XY2mnriAJ gi9xqDFBHVdcmmKRm9z+9Z4wkd9QciP9crxgtqWRd0f85aNolvoS4K8OJE4h1xLzPKTI JTpjyl9TAJXyjwOfnzdGqJmYRSVJ0e/RbraYuC642RyxDbVB0NfI7atSKMbug4aCvlhx 7d+F5UjsxhXe1RfHs9t4Wt74r1bCct25TBQ4PA9XeYHzvccSA5fisa7giSukJk8r0axo sbsOpIWhSMcxoOoBWj/N7WcNijcSCwoUND5moXDzjL40V7BaZPZNsDaf4xkTsC3GQGDv m9XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VQGuM5st; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b24si6617422ejv.254.2019.11.01.12.32.36; Fri, 01 Nov 2019 12:33:02 -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=@kernel.org header.s=default header.b=VQGuM5st; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727797AbfKAT3W (ORCPT + 99 others); Fri, 1 Nov 2019 15:29:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:42454 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727600AbfKAT3W (ORCPT ); Fri, 1 Nov 2019 15:29:22 -0400 Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4546121734; Fri, 1 Nov 2019 19:29:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572636561; bh=j1KP7pjcUgESkZ4XvE0fMh0jUHiONkGtncQhbYNGfKg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=VQGuM5stE1HnHHX0/rKMjhl2CcL6gPIiR5IegIedqZV9LtP0K3PUPaKqiZ/MKXSZA LAFu4aa9tnMPAxIm4eKyd8Joz4koQv0usvrJDZVKT8frTycD5ktAbqySKSTOXBuNti 3XZvZk51mV0e5RqEJJKImxuJprnp7ZKRpoEvANcA= Date: Fri, 1 Nov 2019 12:29:20 -0700 From: Andrew Morton To: Chris Down 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: <20191101122920.798a6d61b2725da8cfe80549@linux-foundation.org> In-Reply-To: <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> <20191101192405.GA866154@chrisdown.name> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 1 Nov 2019 19:24:05 +0000 Chris Down wrote: > 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. On the other hand.. As I mentioned earlier, if someone's code is failing because of the permissions change, they can chmod /proc/sys/vm/drop_caches at boot time and be happy. They have no such workaround if their software misbehaves due to a read always returning "0".