Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1724940imu; Thu, 24 Jan 2019 00:23:21 -0800 (PST) X-Google-Smtp-Source: ALg8bN5Dh2kDotvsWbBA27R1R4tFFuTVSZFyTw3Tmo9qXP8rwRepGFAkI/UDY6hNJ/CQx+uBjEV7 X-Received: by 2002:a17:902:2868:: with SMTP id e95mr5650802plb.317.1548318201790; Thu, 24 Jan 2019 00:23:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548318201; cv=none; d=google.com; s=arc-20160816; b=HR1XySxFduxQkkwLi9GSkL2yYax3Aa+8nZWb58ZvSqZ7Vn5sJcuwIUn2U1QFQM19TD FO6AmM6jM56JUKDmN9XFLzw25yemBKykRP5FuuyimE57BYhj2I6/2DrEmgTdn8jORyfs dXNZ0F+HUjqf7UJgHfnn3NzSNduDY4h7gb0eOccZrtJI5IrspFUlGFksZtWlY6BMsduE 1Bu+Grx7NdhzuIa1htdeIMwm0aIgIegCT8AFOZjXv40yljgxRWZadeevwlgHCr9PKWDk R1wMnpEXa8pRvDlwAUrD7eiGhDituVUDtZ7qyi8EsGqRB1rD2b7Pu745cNErsaGDDVQ5 8MqA== 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=d+dN4/x4kbClRj2+i1OjDeU69CGRN4yFWitqloFfTQA=; b=T9pL3mvA22oUYjVldrkgn5jH3pUPqX/QuuszFYmjiZ5p1Fb28AN6SFF4Z5ONMKSEaG UBBi9AuyE6L7q1zlAVkxVin/ZPMCsn75mKykSAJD9geIq48WC+6+Cfo10fovlm1NJS3z yzUusLTGd4LPOFg+r8QX1dOdarzWCo6CPOvuCG+mQfDHa4yJFBTzuYTpY9Xi5yKdB0um aiukP14aEr6X5r+SR4B3iGWolBqCf38/jSlPVicJIgd1pRLkAEo/vhdZX5JkDlk6b0Cm fDVtfwkBsAPWJLx8qRLP6xXlEKTBZ7bp+F+4yqvpyDbXaBHQuR9aGyHfW5pXH8Nqbbpp fjOw== 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 h189si20859639pfc.211.2019.01.24.00.23.07; Thu, 24 Jan 2019 00:23:21 -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 S1726315AbfAXIWy (ORCPT + 99 others); Thu, 24 Jan 2019 03:22:54 -0500 Received: from mx2.suse.de ([195.135.220.15]:59346 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725939AbfAXIWy (ORCPT ); Thu, 24 Jan 2019 03:22:54 -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 E258FB011; Thu, 24 Jan 2019 08:22:52 +0000 (UTC) Date: Thu, 24 Jan 2019 09:22:52 +0100 From: Michal Hocko To: Chris Down Cc: Andrew Morton , Johannes Weiner , 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 2/2] mm: Consider subtrees in memory.events Message-ID: <20190124082252.GD4087@dhcp22.suse.cz> References: <20190123223144.GA10798@chrisdown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190123223144.GA10798@chrisdown.name> 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 Wed 23-01-19 17:31:44, 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. 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. 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 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. Maybe we want to document this better but I do not see we are going to change the behavior. > Acked-by: Johannes Weiner btw. I do not see this patch posted anywhere yet it already comes with an ack. Have I just missed a previous version? -- Michal Hocko SUSE Labs