Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2110521imu; Thu, 24 Jan 2019 07:23:38 -0800 (PST) X-Google-Smtp-Source: ALg8bN7+HmJuFwagbYqAJAQet5fN/C7B682EIYwfBDqYrYaaYpIsMTNKY/GMNIQzww7ob99XDZk4 X-Received: by 2002:a63:e20a:: with SMTP id q10mr6131193pgh.206.1548343418505; Thu, 24 Jan 2019 07:23:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548343418; cv=none; d=google.com; s=arc-20160816; b=wJVxgk5nTyB1n6orRmFb2HUeRPHbeaTp20TXiBFyOmLOxhdWdtfU9SMQARbyccglOb GM/hR0cpXLzrfaWfg/jpMCslb1Mj21CF4EW9fz/uftGkAsqXxAyFiFQjkQDtCC96AjqO ucOoySlxaSET9XJIMe7XtuieZxTKeA0xkhYmE21UTuY2IJeeth5IK2yvT6mn5cUzoZL8 RINa2rgmak6iFcKPQ/dBvf/u/fnXKGZZpxwt7JDxncjAoJ/PBTJQTwghRlk07uwK9/wB pYe72V8R52iWcvXJaW8ub0K7AfnV0VZkDd+ljjjddjYge4CPUHZzjCnPy2ZPXLuYrUW4 OOZA== 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=oHh6o8jn5g3tJ8EvMOq/zvMTuQRF5UWPWeqXachkSho=; b=F50HZH2QPSUxd0UVbSAr/1NSO3uHRexpudTP896XijGZ5HF0prwwnrYjdwkxx/z7OI Y4QnPfdfy9KnbJFGnwuih865uN6S+izY6DAP2F7NMYNRstAwS4Fu/2Vb3iAKCyJt9S86 VejmXkZviXo7x25XU0S/ViKIhn58N4TUECu8k4GRmMXZ+x63WmpofRw/xR3vReZ33jnH rdPBYFTl201efF+2Nt3Y4gW1m1ObYEpdDW5sFeQNqaA8XIlU6RzRA/sj+lzfXDV1Y6nH haISOiTMEajhqwIJP1SZCV3VMo/ROKdHiL+o0w1UU5uI0DoQjvOK8tkkuLv54BqIUchQ Thdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=ilOnDM8l; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h31si22310532pgl.482.2019.01.24.07.23.21; Thu, 24 Jan 2019 07:23:38 -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=fail header.i=@gmail.com header.s=20161025 header.b=ilOnDM8l; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728076AbfAXPV2 (ORCPT + 99 others); Thu, 24 Jan 2019 10:21:28 -0500 Received: from mail-yw1-f67.google.com ([209.85.161.67]:38138 "EHLO mail-yw1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727562AbfAXPV1 (ORCPT ); Thu, 24 Jan 2019 10:21:27 -0500 Received: by mail-yw1-f67.google.com with SMTP id d190so2548269ywb.5; Thu, 24 Jan 2019 07:21:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=oHh6o8jn5g3tJ8EvMOq/zvMTuQRF5UWPWeqXachkSho=; b=ilOnDM8ll9pxsLgqR2XzLXRMetdJw86ka4AcMniC8p52iV6zbSbAPjjzUt9S1pFVxM RG54FaX6Fu0FURglgfSe5vsP+2EBeMksbHpMOYUz732zHg25PXAt/PsWsn5Tp37LZwSP GygS4W7IdvL0uwu19h43JDoQmrPdVwzxItlVmxORX6uR/t0soxTfgsHUDmBQbBpvQUjx fMZK77CA13TcCnwvKQ3vu5urs9np9Z1aavhPYgLNzJ/u5pcU40iw4/AxKqOTCinIBc5v z2q9JOfcI0TqKCNE2/BQCkV0eS5bEULEWI7DV0JMYu8oUwbg9e2xI9pT6ZO5LjgabUvI aoKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=oHh6o8jn5g3tJ8EvMOq/zvMTuQRF5UWPWeqXachkSho=; b=UuEBn5xV8MbB+ic1AXOyVSGu5fR3mWATkm+sIughfMMYmhfnqxfvIKdiL52rvyZSXL Q2VfltceIVZ41GYKl5i2x5TMDd+eldrWbcoexZKTzu4epvpfMbvzACICNIHDeM5FR9ki N9BSIRD2oIlQpGk0nvoYX7XJAeyobzhbjRbPj5PCAEfgpL70yPt1oORCVBIFVBNGzukS F7C7EKHgca3yb3vmGsuUW9+uZA4znzDT+lMRtYhNmxf3cOGRjLwKh4AsWXdQKU0EBYxW o/qDpmAUoa9S0Zq8nmrvbAa6VhIny7sjLKpWpRI7INAQxHJkNeNB47nk7aHiAGQBln5l 6TQg== X-Gm-Message-State: AJcUukeaIYMIM/2LSJw6zJ15fpok9+VVHwX5KI2y+AGhCi4nDWuWOC4T HJCWo//imbExMRn7qgsOEYQ= X-Received: by 2002:a81:2994:: with SMTP id p142mr6897844ywp.453.1548343286441; Thu, 24 Jan 2019 07:21:26 -0800 (PST) Received: from localhost ([2620:10d:c091:200::4:a8a7]) by smtp.gmail.com with ESMTPSA id k62sm9235932ywk.84.2019.01.24.07.21.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Jan 2019 07:21:24 -0800 (PST) Date: Thu, 24 Jan 2019 07:21:22 -0800 From: Tejun Heo To: Michal Hocko Cc: Chris Down , Andrew Morton , Johannes Weiner , Roman Gushchin , Dennis Zhou , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-mm@kvack.org, kernel-team@fb.com Subject: Re: [PATCH 2/2] mm: Consider subtrees in memory.events Message-ID: <20190124152122.GG50184@devbig004.ftw2.facebook.com> References: <20190123223144.GA10798@chrisdown.name> <20190124082252.GD4087@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190124082252.GD4087@dhcp22.suse.cz> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Michal. On Thu, Jan 24, 2019 at 09:22:52AM +0100, Michal Hocko wrote: > I do not think we can do that for two reasons. It breaks the existing > semantic userspace might depend on and more importantly this is not a > correct behavior IMO. This is a valid concern but I'll come back to this later. > You have to realize that stats are hierarchical because that is how we > account. Events represent a way to inform that something has happened at > the specific level of the tree though. If you do not setup low/high/max This isn't true. e.g. cgroup.events's populated event is hierarchical. Everything in cgroup should be hierarchical by default. > limit then you simply cannot expect to be informed those get hit because > they cannot by definition. Or put it other way, if you are waiting for > those events you really want to know the (sub)tree they happened and if > you propagate the event up the hierarchy you have hard time to tell that > (you would basically have to exclude all but the lowest one and that is > an awkward semantic at best. I don't think it's a good idea to argue this for each piece of information. Again, everything should be hierarchical unless there are clear and strong reasons against; otherwise, we end up with random mix of hierarchical and flat behaviors, something that we want to avoid the most - remember .use_hierarchy?. > Maybe we want to document this better but I do not see we are going to > change the behavior. I beg you to reconsider. This was a clear oversight and the cgroup2 usage is still relatively limited. We sure can add local-specific counters if needed but must not mix local and hierarchical counters without a clear way to tell what's what. Thanks. -- tejun