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 AB8DEC433EF for ; Fri, 6 May 2022 14:57:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EE0AD6B0072; Fri, 6 May 2022 10:57:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E91966B0073; Fri, 6 May 2022 10:57:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D585A6B0074; Fri, 6 May 2022 10:57:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id C70086B0072 for ; Fri, 6 May 2022 10:57:09 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 9A83A21883 for ; Fri, 6 May 2022 14:57:09 +0000 (UTC) X-FDA: 79435620978.20.986BF54 Received: from mail-qt1-f172.google.com (mail-qt1-f172.google.com [209.85.160.172]) by imf20.hostedemail.com (Postfix) with ESMTP id BD8851C002A for ; Fri, 6 May 2022 14:57:01 +0000 (UTC) Received: by mail-qt1-f172.google.com with SMTP id t16so6138700qtr.9 for ; Fri, 06 May 2022 07:57:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=UMiJdnXRi9aL2AL9Vognq71+6oZgB61YztBopTVtQsI=; b=OQ7BK+mietcxdA+xGJIfTtOaowVb7K7X3AIK/p0uNueclD7Y7fS3s2OecMUE77qV1X c5lrVZcv3qzT9iXvcohzhZThbkkrY27rW1TYJFoKXU87Fxb1hBAfMPjp+DroOAMnb6nN +RfzBqhZFn1AVmUXUpoBS9Trkeaxg0rtJvWx8qbh3OrPmSLNw5vnbauJAcTj0z0MhCcG mbYIi4s4dytVvlg4zrOl3UEGEs6uXvVXQF4xq6kn4ruyxufmUY7+/P7yQuNSuYV6koW5 B/kpsin/bvmMqHv6TwomKQg2J7PkZUjlJwogTKj2UXnpv+Dy9OYdeHM54qs9blfKuACF kiIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=UMiJdnXRi9aL2AL9Vognq71+6oZgB61YztBopTVtQsI=; b=KQ1Ko1JzGukhYMF74gv1cjCTQKqomrCb2RzJfnX4GKDMQUgLBC/rWZaD+u3U+uF7Ok 5gDmfzdeDzVItrZqJTMFtWkFbwHbquhmo6Jvb6CJLKN6n1Kw8ku7Rp2sY6xHpjoZ2qLK YcduACZEBW7myujDoZkS4XZG5u9wTOSQ41RhrqY0XsWqCn+QxLyjNQ+llQfSmU0z36cC KJdOqcAIJkcZCAR69vsY8quq5L4RL8VgMu9KroX90K/I5mtPIhMzImXByr5+zCynW+0U 9SIca81Ya4O9gnJi95MxssqJL5me0HZnLqm9LbXdP2D59nch4xSKuhRocWOZ3Lw1KWZ6 +VJQ== X-Gm-Message-State: AOAM530EbaMJb2jWtSN1dp0kkP/Me3/wfha+bPVOrAipYUlmaVAT7C0O AXeftX9LZ4mmB9U3In6mXLCCgg== X-Google-Smtp-Source: ABdhPJw5KlQIWwHvnoYh6CGzeMwc2xD2ZeoiJt6REs1ah2m8tXsLfJ8mfGEirSewIBncZHGs+ozCrg== X-Received: by 2002:ac8:5245:0:b0:2f3:a331:b045 with SMTP id y5-20020ac85245000000b002f3a331b045mr3085687qtn.570.1651849028187; Fri, 06 May 2022 07:57:08 -0700 (PDT) Received: from localhost ([2620:10d:c091:480::1:538c]) by smtp.gmail.com with ESMTPSA id k6-20020ac81406000000b002f39b99f69fsm2577960qtj.57.2022.05.06.07.57.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 May 2022 07:57:07 -0700 (PDT) Date: Fri, 6 May 2022 07:56:18 -0700 From: Johannes Weiner To: Ganesan Rajagopal Cc: mhocko@kernel.org, roman.gushchin@linux.dev, shakeelb@google.com, cgroups@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH] mm/memcontrol: Export memcg->watermark via sysfs for v2 memcg Message-ID: References: <20220505121329.GA32827@us192.sjc.aristanetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220505121329.GA32827@us192.sjc.aristanetworks.com> X-Rspamd-Queue-Id: BD8851C002A X-Stat-Signature: 955pdsuy3zshrxbb6i4ysrabhmcfbyog X-Rspam-User: Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=cmpxchg-org.20210112.gappssmtp.com header.s=20210112 header.b=OQ7BK+mi; spf=pass (imf20.hostedemail.com: domain of hannes@cmpxchg.org designates 209.85.160.172 as permitted sender) smtp.mailfrom=hannes@cmpxchg.org; dmarc=pass (policy=none) header.from=cmpxchg.org X-Rspamd-Server: rspam09 X-HE-Tag: 1651849021-433336 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000807, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.