From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 096D9C433F5 for ; Fri, 6 May 2022 15:56:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 63BAC6B0072; Fri, 6 May 2022 11:56:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5EA7E6B0073; Fri, 6 May 2022 11:56:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 48B406B0074; Fri, 6 May 2022 11:56:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 34C676B0072 for ; Fri, 6 May 2022 11:56:44 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 0973321B29 for ; Fri, 6 May 2022 15:56:44 +0000 (UTC) X-FDA: 79435771128.02.9544BBF Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by imf01.hostedemail.com (Postfix) with ESMTP id 4192C40020 for ; Fri, 6 May 2022 15:56:34 +0000 (UTC) Received: by mail-pf1-f177.google.com with SMTP id bo5so6592564pfb.4 for ; Fri, 06 May 2022 08:56:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=m81d4j0n4jrU8+EkDRIdTToCet26p62xWOxrVZBvafg=; b=S1iVkf0yZxiaHzRBF42XNyBBVYQtqIWrWcb4akJVYnJMmXnItPsVLmg4coDg8m/z67 zbApxIKZInjNBYxMJw8GIMzyj7M3bgKFUnKdDhR/ihqiUbAQkrfwyXdCvuTc/G/2I+4h dWxhx4OhlpzjbIwrxJblu6/FndBQSKOCVwpoCXNUsiWW/IMOJmsWE/bLctyGJdeaJOCb aRQE95Jbf47BWzr6ax2qXBxI7K+cBRdcaxoFdUKc5y16WUBwk0VM2M5GNhyCZqOk4Wkw F9Bvu8K6Ft+b68SNWYjQMKhxpzKetTu3oAOcHDoSa/7tlueVVUgn83GnY5mOciJpzE0O Y9gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=m81d4j0n4jrU8+EkDRIdTToCet26p62xWOxrVZBvafg=; b=nHQWchF0I/YE/V+i37H52UtRrbZNIUmIQfr214FYhQZYjLvtmM0Ls3RByRpX3tSX1R MCoxHxGeKcyvgCQaNRKPH/Mo1TMji8d6nH47e1soD6iD9pZ98OqI68Sei8Y2tvudIiDw Xzz8zEFP7flX9pZVb5ZtWW67oh5eeuiRIqBjTWqQS6i2HRsXKl/T23hUx0AL3/pZNxtg qTfLonxdpBZe2aCamALfvyUx3T7wfoCci86prhFXaoD65SGgxNo4qy+F4BOomDZF6KKx G4/kLosu63DYUfdaZ4jid51JtKh3Z/vGrom5HoAaC244mmNfdTPRdguE6dq/dDgVFrAn aixg== X-Gm-Message-State: AOAM530sqE9KeoTrfwFph4BdUDKs2D73sStO36GT9urWCE8C38vHxFZb skgUpYVPWz6BbahxAGb7mQf/A/xFF/leWT0yZDazpQ== X-Google-Smtp-Source: ABdhPJziffrcGvlPDxqjGz/Vr0ekqIFtG6zrGIg+rMwoZp9uSB2un9q9wNrJB1PRhDQhf9QHDrzZV/ayRSY3fzj/qso= X-Received: by 2002:a63:382:0:b0:3c2:1669:e57b with SMTP id 124-20020a630382000000b003c21669e57bmr3299293pgd.509.1651852602162; Fri, 06 May 2022 08:56:42 -0700 (PDT) MIME-Version: 1.0 References: <20220505121329.GA32827@us192.sjc.aristanetworks.com> In-Reply-To: From: Shakeel Butt Date: Fri, 6 May 2022 08:56:31 -0700 Message-ID: Subject: Re: [PATCH] mm/memcontrol: Export memcg->watermark via sysfs for v2 memcg To: Johannes Weiner Cc: Ganesan Rajagopal , Michal Hocko , Roman Gushchin , Cgroups , Linux MM Content-Type: text/plain; charset="UTF-8" Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=S1iVkf0y; spf=pass (imf01.hostedemail.com: domain of shakeelb@google.com designates 209.85.210.177 as permitted sender) smtp.mailfrom=shakeelb@google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspam-User: X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 4192C40020 X-Stat-Signature: wcges3psi97xjqj41daw3dwikgmqfqmt X-HE-Tag: 1651852594-879584 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000166, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, May 6, 2022 at 7:57 AM Johannes Weiner wrote: > > On Thu, May 05, 2022 at 05:13:30AM -0700, Ganesan Rajagopal wrote: > > v1 memcg exports memcg->watermark as "memory.mem_usage_in_bytes" in > > sysfs. This is missing for v2 memcg though "memory.current" is exported. > > There is no other easy way of getting this information in Linux. > > getrsuage() returns ru_maxrss but that's the max RSS of a single process > > instead of the aggregated max RSS of all the processes. Hence, expose > > memcg->watermark as "memory.watermark" for v2 memcg. > > > > Signed-off-by: Ganesan Rajagopal > > This wasn't initially added to cgroup2 because its usefulness is very > specific: it's (mostly) useless on limited cgroups, on long-running > cgroups, and on cgroups that are recycled for multiple jobs. And I > expect these categories apply to the majority of cgroup usecases. > > However, for the situation where you want to measure the footprint of > a short-lived, unlimited one-off cgroup, there really is no good > alternative. And it's a legitimate usecase. It doesn't cost much to > maintain this info. So I think we should go ahead with this patch. > > But please add a blurb to Documentation/admin-guide/cgroup-v2.rst. No objection from me. I do have two points: (1) watermark is not a good name for this interface, maybe max_usage or something. (2) a way to reset (i.e. write to it, reset it).