Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2139308imu; Thu, 24 Jan 2019 07:52:03 -0800 (PST) X-Google-Smtp-Source: ALg8bN4TEPVaoAGc3L+L9x5rmdxX/pzboRNTQhob+XvWZHlo1VmG9bBOOm+J2ZhgV2w1dGtkMZAB X-Received: by 2002:a63:d157:: with SMTP id c23mr6328267pgj.170.1548345123319; Thu, 24 Jan 2019 07:52:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548345123; cv=none; d=google.com; s=arc-20160816; b=CmoWGS9hQpUasBu4eosxy00IPoKwA4b2K/3rolBzfgWswNy1tFjILzGUG6ymipQ2YP MCq1HE/+3G5Gj4awEff6H43e28P7/AqrILzJwMY3Ve+2znQEI8kzKsAz7RcZOb46DKFO T6u0/1s4AMlEIWRDkGO4D+eX6t6W0c7oWN/paj8kH5mCMPq8/bPfQ/UpuoC2zDqjJhR3 a2gXLWDGMNnXuFeVygpKn5DuGxe46NG3nOYc/GFAUYa1Xn7edwBoFjWBQK/kVl6rhHss qRWPg4TLyxCtHRZdoZCQTy3LP/S1Xm802tFST0irWvIFq/adiM3VzBaBPqi1CIK88Gy0 mssw== 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; bh=NA76K0TTEqp9LveUUg6x1kjWgUcxeEJdbHGVUN57asY=; b=SJaBvaFhYx79hHLkwtNoqTQv7hER6lMVHO0ukiJ7IyqbLKPPTHOuxkQ7OuU05Q1Qc8 PaTtr9zGIk5ed/QDs70gBndGjeloy5vtei8ZF7HsoGggjBrPv3qMCheA7YzztKDFecTM CKXOVgxX6zirrNLTb/JUMCf5gC4w2dpwnYuGpIuyMO+NOD0saoHp0gbmCcue5065AACs fUkAnT+Ds9XumDfaROMUsLvX+o3Q+MjurDS1T3pfzZN1Z/jQrj8wZvfAcmQhnZGX/KuH G9YtId9/Eyr39C7b+GwqKeiHFbhvqfZoRadXv4ptwCWDSjoN/zwUPLkgvbGRozNy30h/ Ov7g== ARC-Authentication-Results: i=1; mx.google.com; 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 f23si4472602pgv.431.2019.01.24.07.51.46; Thu, 24 Jan 2019 07:52:03 -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; 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 S1728589AbfAXPvY (ORCPT + 99 others); Thu, 24 Jan 2019 10:51:24 -0500 Received: from mx2.suse.de ([195.135.220.15]:58834 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727566AbfAXPvX (ORCPT ); Thu, 24 Jan 2019 10:51:23 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 6AF6AB009; Thu, 24 Jan 2019 15:51:22 +0000 (UTC) Date: Thu, 24 Jan 2019 16:51:21 +0100 From: Michal Hocko To: Tejun Heo 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: <20190124155121.GQ4087@dhcp22.suse.cz> References: <20190123223144.GA10798@chrisdown.name> <20190124082252.GD4087@dhcp22.suse.cz> <20190124152122.GG50184@devbig004.ftw2.facebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190124152122.GG50184@devbig004.ftw2.facebook.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 24-01-19 07:21:22, Tejun Heo wrote: > 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; And I would argue that cgroups.events with its populated event is a different thing because that is inherently a hierarchical property. If you compare that to low, min, max and oom those are events very specific to the particular level of the hierarchy because it is an action at that level that the event informs about. E.g. max event down the hierarchy is a completely different thing from the upper level. That sounds like a pretty solid reason to differentiate here. > 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. If you really have a usecase for hierarchical events then I think the only way without breaking existing userspace is to add a new set of events. But I still believe that the current behavior makes a lot of sense. -- Michal Hocko SUSE Labs