Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp837140ybx; Fri, 1 Nov 2019 12:02:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqyRo19lAAr+ndyG23hjPD7hW0q51o9S0ROUFI4k3HwIQT6cVb6d0pyJuqpXd9Lq1FfhH4DU X-Received: by 2002:a17:907:10d6:: with SMTP id rv22mr4962927ejb.331.1572634945083; Fri, 01 Nov 2019 12:02:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572634945; cv=none; d=google.com; s=arc-20160816; b=I0/btlHQvgSCmS1AePKxHiN+QwORpHMGTNfJyNUV9tddFVMUCg2/GucTq+yTG43nDj FGvu2IkypFkT43zN4Mg+yHJyQ+j11w0xsGMZlpgHVHK9ImVyu11RXrOZB5cJAJBdNe5y 92BxdhLm4B9Tyrx+WHxCn/D11oX8ORpkRSvQ7b1nTGkbhPqwFv6vaOKGS5yQE6gE7Ihp cUNc32DnEFEdlGFAy2OzEiINQ7/vRZoSl99YF4sH2rBvwQJuMdMZ2NF5U1UM0tykplSD DWJDlrvBSal3mqRkE93iob1s7fh/jv8rb0uHL+4kOefmiKW9GDKlI+0unwcMTQDIMD3p 0Prw== 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=/9UAmpGmiToFF8t4rHNeWT6Iy3tRXi2ZzMn3SaUAPuU=; b=zy+/y9jSAlhDy62nKDAeakjSveVO5zmQKs97TZV8RwN0xvUXIiQPOeAIAOmr/XgtKE dfqJECxVQIjEDK7r/3QnsjRB472b8vhZyAX/pQseH8L1BbVyMwkh5uaz1l9w3HR1J06T HMonYo6skDIr8phIgIv18eUu7CY/vghxDJB3UQ8uUD2GQiSXxxiAXGoFZWKSN7CsBkCr d9NUfzr5T9mlYDje5ayZq8RaP4OevEPp58Zymi/7w95ZIwZYwcEgOGHWEBg2SQGEXDgy dSMiR/2A4PcA7SPseQOIHKBKqfKkIYQ337ZshBWHraaLoHcZv/qvNQu3SSZk7wNeRFr1 8X8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=l5otfoxV; 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 y22si6731600eju.150.2019.11.01.12.01.59; Fri, 01 Nov 2019 12:02:25 -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=l5otfoxV; 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 S1727687AbfKAS7w (ORCPT + 99 others); Fri, 1 Nov 2019 14:59:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:34988 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727529AbfKAS7w (ORCPT ); Fri, 1 Nov 2019 14:59:52 -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 534F9217D9; Fri, 1 Nov 2019 18:59:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572634791; bh=lRVpk7cBWykOpWgnyK3qxsXb6qvYPBxlHllAXwYHWwk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=l5otfoxV3jIeKhh3tTE18TRy+G1CxJ8fZccktuHdF17wreK35qAXHBY6D9TS+ayxd wCIN6UBhh6lF7CxYJlJISu/6ZA2hOdOL+bhdtvPkpfUcR1RbL52fzvwwI9+sbgra2s umulqdmc/Ty/5V6c1BIsmhXh4qqoIjArHsfzAihs= Date: Fri, 1 Nov 2019 11:59:50 -0700 From: Andrew Morton To: Johannes Weiner Cc: Chris Down , 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: <20191101115950.bb88d49849bfecb1af0a88bf@linux-foundation.org> In-Reply-To: <20191101144540.GA12808@cmpxchg.org> References: <20191031221602.9375-1-hannes@cmpxchg.org> <20191031162825.a545a5d4d8567368501769bd@linux-foundation.org> <20191101110901.GB690103@chrisdown.name> <20191101144540.GA12808@cmpxchg.org> 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 10:45:40 -0400 Johannes Weiner wrote: > On Fri, Nov 01, 2019 at 11:09:01AM +0000, Chris Down wrote: > > Hm, not sure why my client didn't show this reply. > > > > Andrew Morton writes: > > > Risk: some (odd) userspace code will break. Fixable by manually chmodding > > > it back again. > > > > 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? > > > Reward: very little. > > > > > > Is the reward worth the risk? > > > > There is evidence that this has already caused confusion[0] for many, > > judging by the number of views and votes. I think the reward is higher than > > stated here, since it makes the intent and lack of persistent API in the API > > clearer, and less likely to cause confusion in future. > > > > 0: https://unix.stackexchange.com/q/17936/10762 > > Yes, I should have mentioned this in the changelog, but: > > While mitigating a VM problem at scale in our fleet, there was > confusion about whether writing to this file will permanently switch > the kernel into a non-caching mode. This influences the decision > making in a tense situation, where tens of people are trying to fix > tens of thousands of affected machines: Do we need a rollback > strategy? What are the performance implications of operating in a > non-caching state for several days? It also caused confusion when the > kernel team said we may need to write the file several times to make > sure it's effective ("But it already reads back 3?"). OK. What if we make reads always return "0"? That will fix the misleading output and is more backwards-compatible?