Received: by 2002:a17:90a:2044:0:0:0:0 with SMTP id n62csp530356pjc; Mon, 20 May 2019 11:19:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqxlGxZqF7e7/Uh2rIH5ijGRjCgvgzhd8uNhWdpcXU1zLOj4NjPwDp3xl8Fy1aZOdz0EUdOW X-Received: by 2002:a62:1844:: with SMTP id 65mr69546121pfy.127.1558376384554; Mon, 20 May 2019 11:19:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558376384; cv=none; d=google.com; s=arc-20160816; b=XKhKAMXqU/vg5nmiU7xEcpXWdhMv/WBia5zuUgr1isi2VBXGrtE0UC2q0vzY8tTxau K0DEAwdk6QnwNydlN3vn5FnkbMMI+xdrf+h06pit8m/tf60Lg0iMzXXiMzKWNOTl2oFs 4Mj6xCtadFuFSWsW2raYRGb9Z1w7exQFRcI7ut2fDMd9GA3Pk4LVJG/JxByTYS5sP3t3 XwmUkHXkwFa2HkeZevdDtry3upu3mQqYDG1YpRrT0UfuFpKMWch3Db6U5vaP8bj/rAdz nXd58IHP4wHlT3dJw5rzC8da5ZwmlKwiaZntZ1okWV7kzQ1pE5nYQdeV4N0ryFhRXYKH 5ZrQ== 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=4ZOI+jnwXBptD9UIpostnVMZFPCwcvxnpKvL3qurL40=; b=wFahAf7CtH1lZBeTfnFWxv6l5NnfTlx7XWmO8OdpK+RcH2areHkzKT3/i8pVwXZjy1 ySKCxQyB3JPBkn3OYkImqE1M7/p+EwnB7mgv8+eAU83faaAAsbECefYrcEpZZGdCZNKJ k8HRLugeerTkkmd4xnrd0K/FXKcqufT/hl4Hp7t4RUc9kxOXpiTFjIPlC5VSnsVdK/+B Y4D4kxPxILD/HUwOw1T3NuqzE7DnhhhOmqDCoq1RTPq4RNOlVhxYyN/tOwHzpkMQEtWv kqzrsnRXuCtDProCfQIIDzUWeyipHFHc5wV+4n1dkWBDtYLofTbiragzZyD2ZOt5++gv XIiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=Rg3JGm7c; 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 x8si17880970plo.342.2019.05.20.11.19.29; Mon, 20 May 2019 11:19:44 -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=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=Rg3JGm7c; 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 S2392700AbfETRFc (ORCPT + 99 others); Mon, 20 May 2019 13:05:32 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:41212 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390006AbfETRFb (ORCPT ); Mon, 20 May 2019 13:05:31 -0400 Received: by mail-pg1-f196.google.com with SMTP id z3so7071811pgp.8 for ; Mon, 20 May 2019 10:05:31 -0700 (PDT) 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=4ZOI+jnwXBptD9UIpostnVMZFPCwcvxnpKvL3qurL40=; b=Rg3JGm7cAcDM+AZNutQuRwGkJ3ubXbt1UCwOCgZnkJntyOzhCrWnunCiEjWY7ROSIZ kVmBbyBsGGB57A5oVMp546xpWJgwU/oSoyDYqohN31no/hHulLW0cV3TFXQxHRGm3Arh oZI0B0sNElaQefwHOOurYmhojHza1z+7f0MdJSYwJgf0UX78I0BFmHNhkkyTJP+ysJgA 1oq4KvyqLM9FGoFmGF0bhA3gzuw3Xcn/MOZUKRVRWJpoiE+3D/NOeDKnUVfhlEhq8tFr ACelj15Q04D4dmGoY8dB6fOkc4qS2Hmb9f4IVHnDWYoNGwTJItV3oZNqdJ6Lf+b5E2oC /1IA== 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=4ZOI+jnwXBptD9UIpostnVMZFPCwcvxnpKvL3qurL40=; b=tdQ0b/McJPpDZIqnN7SeA5ylS0nv3sgIDtu9QiArsGaXyxBBNhnZ2AACfzBHcyPNae n00zpRy53G2zZN3PkCKqxxX2KU6bFW1Ksrmn5e0Z1nD3Z7i2hwgrVtVrs9zhsaJidrkE AYdSkd/QxDYkmYh65wwIjDHyaOGDXl6HxirjmuJ5E7Cx4MKEoa/ySVnMeOVDpOAf2HWy 8uWRorsLyk7bhpXWY2NWPoWXCurOMVOnJAefAMyh9QY5xmDN9it33WB7lZfyc1rUQ3SB G22RG6ARCxZ27X+Jg6z+9Wnyjlfw1lOKVi0sEOIvcOeHzyxJ35nKY97+bTON+Yjq7SHS 91sA== X-Gm-Message-State: APjAAAVdA255nny5gWJcESo7WD9kqre8UdJBcFFpVoxdjNYcmDsz8NCK GIrNdtUMo6/NvrqPhtZLMwJFdw== X-Received: by 2002:a63:1045:: with SMTP id 5mr32327108pgq.55.1558371931150; Mon, 20 May 2019 10:05:31 -0700 (PDT) Received: from localhost ([2620:10d:c091:500::3:df5f]) by smtp.gmail.com with ESMTPSA id u76sm21219972pgc.84.2019.05.20.10.05.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 May 2019 10:05:30 -0700 (PDT) Date: Mon, 20 May 2019 13:05:28 -0400 From: Johannes Weiner To: Shakeel Butt Cc: Vladimir Davydov , Michal Hocko , Andrew Morton , Roman Gushchin , Chris Down , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] mm, memcg: introduce memory.events.local Message-ID: <20190520170528.GC11665@cmpxchg.org> References: <20190518001818.193336-1-shakeelb@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190518001818.193336-1-shakeelb@google.com> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 17, 2019 at 05:18:18PM -0700, Shakeel Butt wrote: > The memory controller in cgroup v2 exposes memory.events file for each > memcg which shows the number of times events like low, high, max, oom > and oom_kill have happened for the whole tree rooted at that memcg. > Users can also poll or register notification to monitor the changes in > that file. Any event at any level of the tree rooted at memcg will > notify all the listeners along the path till root_mem_cgroup. There are > existing users which depend on this behavior. > > However there are users which are only interested in the events > happening at a specific level of the memcg tree and not in the events in > the underlying tree rooted at that memcg. One such use-case is a > centralized resource monitor which can dynamically adjust the limits of > the jobs running on a system. The jobs can create their sub-hierarchy > for their own sub-tasks. The centralized monitor is only interested in > the events at the top level memcgs of the jobs as it can then act and > adjust the limits of the jobs. Using the current memory.events for such > centralized monitor is very inconvenient. The monitor will keep > receiving events which it is not interested and to find if the received > event is interesting, it has to read memory.event files of the next > level and compare it with the top level one. So, let's introduce > memory.events.local to the memcg which shows and notify for the events > at the memcg level. > > Now, does memory.stat and memory.pressure need their local versions. > IMHO no due to the no internal process contraint of the cgroup v2. The > memory.stat file of the top level memcg of a job shows the stats and > vmevents of the whole tree. The local stats or vmevents of the top level > memcg will only change if there is a process running in that memcg but > v2 does not allow that. Similarly for memory.pressure there will not be > any process in the internal nodes and thus no chance of local pressure. > > Signed-off-by: Shakeel Butt This looks reasonable to me. Thanks for working out a clear use case and also addressing how it compares to the stats and pressure files. Acked-by: Johannes Weiner