Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3034263imj; Mon, 11 Feb 2019 12:40:06 -0800 (PST) X-Google-Smtp-Source: AHgI3IYlmYpwzp1pn+EbhBdmN6CgpXsWnWrXAN33U/WQRpfhG3JTVDP8jLH7+k92YTB4ZVytKfnh X-Received: by 2002:a17:902:ba8b:: with SMTP id k11mr87104pls.177.1549917606440; Mon, 11 Feb 2019 12:40:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549917606; cv=none; d=google.com; s=arc-20160816; b=TIW2WWuywizQTE7S7Ok807jmZ5sLSU/FUUdPUVWCPRfxbV0EMoJhU6atEUGWJms8UA h3U7F3MRULY2WJaXtAF+/MkNsUY13WRS2r72XmldrPdyA6Oc+LBHQyyLgPb3GKEhwSVT tcdJPv1TAMMVcDFIPIgzhrDJGAxfwGDJpdul4YgJMcuaTs3GnlZsGjSSdAFcO6P0L3TC bkhI+1wcEueOFqmfTgKbVmYQP/vpnxye0ni/eZDdo+Q7TW3QVFrDr4QMbt99z+p4vmK/ xa1VU81XUQg7cgxD+Jwl8o0Pz9DahzQ/hwPLC9skJ0f6sH/EMdmx4Njho7P9yEi3zP0Q IL9Q== 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=s09oajM8sRG6VR42JLX9NXyJV4gfvXuCrn6cD3FbZqw=; b=l+9Okon9sel15k1X/fgiEq+zbmZ3y32HcKLO8wmcxTJni2BjLjkmqckGAx2X/06xV0 ER+/R0TsLMG0/4xqj1MrxzJL4HSlQ1caK6d1qJPL7UrIyYIXem7GO7uNxsymaCQbkJFa WMx0gTQSmZ6it9Qpfw2Oqbrk1cKTsww1eD+GTUwi0X8zfJO3u+bvVzbD6AZ42oyxVk7p nb78c08H1a+Yn1aiWq5FJkfLJr8Tvp+cdYyFoJJNXkIz9CRq4/u/YKUxmatX1dT6wiRS a5EvHG6LTHqfRzifPcAlurD5yQc5D/E5yQ3/v9qHSurpyhig5LF7OI9yIGwgIX9DRsbW i5sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=fR9XwG2I; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33si9055890plk.183.2019.02.11.12.39.50; Mon, 11 Feb 2019 12:40:06 -0800 (PST) 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=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=fR9XwG2I; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387465AbfBKTBX (ORCPT + 99 others); Mon, 11 Feb 2019 14:01:23 -0500 Received: from mail-yw1-f68.google.com ([209.85.161.68]:46585 "EHLO mail-yw1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733289AbfBKTBS (ORCPT ); Mon, 11 Feb 2019 14:01:18 -0500 Received: by mail-yw1-f68.google.com with SMTP id n12so4597265ywn.13 for ; Mon, 11 Feb 2019 11:01:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=s09oajM8sRG6VR42JLX9NXyJV4gfvXuCrn6cD3FbZqw=; b=fR9XwG2IpAJnHWw0MPBfz0HAX7xH++BkHbFzdYsjyY2FzzSQFnOya2QKZoELQ/IC5O 8Dk/hBPxZ0V9ikPopvPDe6YxClqHJSPNu1lZ87Q2cVLMHwm3C8kKQ6WVmLFZXPEsz3HR nk0JyG9P2MV9qyR1u2B3Xw3gJO/S9XhKwPznBWi+552PjkO8ma2qfoEUpctr7+xltiHq U0S6AsRR2MhGChi8V+igCAz55oV0a1ftWgNSfONzCoxSz9AXXndTZ37wJ/dMBqvXEFXY +XOiZ81yTVgf8Ej4uzhR7/jhIkE2VBZSgSaFyAlZwRqoU0RCaJewWGnOx0Db/jxAlBs3 WMrg== 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=s09oajM8sRG6VR42JLX9NXyJV4gfvXuCrn6cD3FbZqw=; b=TQuhH0BaxvHBjRihirdSSdXqn7AULVVWH1sr8U0A9WP2jR7O0A/BcuCQJsVoID7ZKe o0XCK76pT+sVfc38dgOmchh9Ko7NO7ZlgcnlYOAegjtAiTXLf7XV9Y7SoHKcmj+Gum8W FcRt6eqOxEv2OMGzgHzO4fc35HDGP/x4ATVeTojJsOZwe8tY+zE+wRwi9nSzJlUrZ6Mi 6e9kByySD5/pmeWrJtV/h+VezIg8q2WYEpwMYcd9odO5BzTlgpFGLjA0iMyaLbI21BKe UhtOHKXNtTgF9xI87nRpqqGs0EovXPqBh38PRMkxRY0WL9buc/JwLry7pcjhJdZCoa8H COQg== X-Gm-Message-State: AHQUAubucF0a/M65yKjn06Q5rSmntg9R5ucwiPj7Kp2GjHD9y0KAiM3C 88cR3wMXl3RKciat/G9V/E3oVA== X-Received: by 2002:a81:a9ca:: with SMTP id g193mr30060659ywh.52.1549911677658; Mon, 11 Feb 2019 11:01:17 -0800 (PST) Received: from localhost ([2620:10d:c091:200::5:6e5]) by smtp.gmail.com with ESMTPSA id h62sm4103600ywe.100.2019.02.11.11.01.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Feb 2019 11:01:16 -0800 (PST) Date: Mon, 11 Feb 2019 14:01:15 -0500 From: Johannes Weiner To: Chris Down Cc: Andrew Morton , Michal Hocko , Tejun Heo , Roman Gushchin , Dennis Zhou , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-mm@kvack.org, kernel-team@fb.com Subject: Re: [PATCH v2 2/2] mm: Consider subtrees in memory.events Message-ID: <20190211190115.GC13953@cmpxchg.org> References: <20190208224319.GA23801@chrisdown.name> <20190208224419.GA24772@chrisdown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190208224419.GA24772@chrisdown.name> User-Agent: Mutt/1.11.2 (2019-01-07) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 08, 2019 at 10:44:19PM +0000, Chris Down wrote: > memory.stat and other files already consider subtrees in their output, > and we should too in order to not present an inconsistent interface. > > The current situation is fairly confusing, because people interacting > with cgroups expect hierarchical behaviour in the vein of memory.stat, > cgroup.events, and other files. For example, this causes confusion when > debugging reclaim events under low, as currently these always read "0" > at non-leaf memcg nodes, which frequently causes people to misdiagnose > breach behaviour. The same confusion applies to other counters in this > file when debugging issues. > > Aggregation is done at write time instead of at read-time since these > counters aren't hot (unlike memory.stat which is per-page, so it does it > at read time), and it makes sense to bundle this with the file > notifications. > > After this patch, events are propagated up the hierarchy: > > [root@ktst ~]# cat /sys/fs/cgroup/system.slice/memory.events > low 0 > high 0 > max 0 > oom 0 > oom_kill 0 > [root@ktst ~]# systemd-run -p MemoryMax=1 true > Running as unit: run-r251162a189fb4562b9dabfdc9b0422f5.service > [root@ktst ~]# cat /sys/fs/cgroup/system.slice/memory.events > low 0 > high 0 > max 7 > oom 1 > oom_kill 1 > > As this is a change in behaviour, this can be reverted to the old > behaviour by mounting with the `memory_localevents` flag set. However, > we use the new behaviour by default as there's a lack of evidence that > there are any current users of memory.events that would find this change > undesirable. > > Signed-off-by: Chris Down > Cc: Andrew Morton > Cc: Johannes Weiner > Cc: Michal Hocko > Cc: Tejun Heo > Cc: Roman Gushchin > Cc: Dennis Zhou > Cc: linux-kernel@vger.kernel.org > Cc: cgroups@vger.kernel.org > Cc: linux-mm@kvack.org > Cc: kernel-team@fb.com Acked-by: Johannes Weiner