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 01E6CC433EF for ; Thu, 12 May 2022 02:48:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5EAE36B0075; Wed, 11 May 2022 22:48:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 59A3C6B0078; Wed, 11 May 2022 22:48:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 461BC6B007B; Wed, 11 May 2022 22:48:40 -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 34DDF6B0075 for ; Wed, 11 May 2022 22:48:40 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 0D30520AD2 for ; Thu, 12 May 2022 02:48:40 +0000 (UTC) X-FDA: 79455558000.13.D8D4EE0 Received: from mail-io1-f44.google.com (mail-io1-f44.google.com [209.85.166.44]) by imf23.hostedemail.com (Postfix) with ESMTP id 95EBA14009B for ; Thu, 12 May 2022 02:48:25 +0000 (UTC) Received: by mail-io1-f44.google.com with SMTP id e15so4014063iob.3 for ; Wed, 11 May 2022 19:48:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arista.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=xtNpsVsaVZqX+nLgswyUb5xinkvrzu2jSXspDWuy6ao=; b=IsD81cUQTxFLLiCf8ZUh17UC4XEeB4YvQSbZCBminUMBlEwBgG1pdELuzADA6mkmtO bN1VjOS1G4iq0pPoFUuCdL01CJPbcWU/jtZw/r/Iw/TWW2O2sT/2DBYeDEPg6REYgnrx YiCvy2OBG7mUbOCxCwSOXiZdIZ70fNYpvxx8gsQb92k4LR86sHH8dW4LgzPXNe4UYBHh WQvvU2HywxJjxSnkQv86Z36xEoxTmZsLGF6pfr8mdrPMu72RHi7UYdQ9kJmIf66MC7M/ T7aFNuI8/YhJogcUESiT9cTOYQR7Z5pg2ExCQ17zeq3NYowpC/JW6BdAXop6h+lPNa2e d0Kw== 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:content-transfer-encoding; bh=xtNpsVsaVZqX+nLgswyUb5xinkvrzu2jSXspDWuy6ao=; b=jo+KebcIf2hDXvx6nHX6BqBthWQfh0u0HZXUbXA24K4b5aeDbS4wwpNZptSgzEYLqX uiTNl9Q6l2bNeivGm/fN7uP7f4Rumgw4M2Kub9TIopMa/wwkU5zQW8yFoPUk6kiSc2Re VrAMSIzwhrEDg9weQi6tln2SXM55OAu5FrIZty1d2bq2vBItLIb8H2lSouIZVr/6f60W bmgR9I+SkmPqiFt7KUhAB4PhUgv98avXWOSRDu3SRKcbTvN/6XW/Y5OlhwqhoQqLtfet 43JMZfe2Vt9EJFF9djWAxU9DZ9z+17N0G959hpwWB/ARU/40hi4ZiPGzY5YGh8AXBvIi SZEQ== X-Gm-Message-State: AOAM532C621f8Rw6l3a4SIabrmVMg/XQFTUrxBxVl+nbqicen6gKEYUD IXhyLtRPgDM2quSDkE2RWzzI3VTO6SswNBdXf/ieTw== X-Google-Smtp-Source: ABdhPJzi3anp8Q8gPIsD6XBEhZ/Loy2GtAZEdcg7f2IXP18hLfoq33T/Bwoc33Z98HXk2skhR9bYB+eRGvoSa1EShGQ= X-Received: by 2002:a02:3b07:0:b0:32a:efae:69ce with SMTP id c7-20020a023b07000000b0032aefae69cemr12979932jaa.275.1652323718649; Wed, 11 May 2022 19:48:38 -0700 (PDT) MIME-Version: 1.0 References: <20220507050916.GA13577@us192.sjc.aristanetworks.com> <20220511174953.GC31592@blackbody.suse.cz> In-Reply-To: <20220511174953.GC31592@blackbody.suse.cz> From: Ganesan Rajagopal Date: Thu, 12 May 2022 08:18:01 +0530 Message-ID: Subject: Re: [PATCH v2] mm/memcontrol: Export memcg->watermark via sysfs for v2 memcg To: =?UTF-8?Q?Michal_Koutn=C3=BD?= Cc: hannes@cmpxchg.org, mhocko@kernel.org, roman.gushchin@linux.dev, shakeelb@google.com, cgroups@vger.kernel.org, linux-mm@kvack.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=arista.com header.s=google header.b=IsD81cUQ; spf=none (imf23.hostedemail.com: domain of rganesan@arista.com has no SPF policy when checking 209.85.166.44) smtp.mailfrom=rganesan@arista.com; dmarc=pass (policy=reject) header.from=arista.com X-Rspam-User: X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 95EBA14009B X-Stat-Signature: w4hkhz6qsbbrub446q4nh7is9b5af9br X-HE-Tag: 1652323705-205041 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, May 11, 2022 at 11:19 PM Michal Koutn=C3=BD wrot= e: > > Hi. > > On Fri, May 06, 2022 at 10:09:16PM -0700, Ganesan Rajagopal wrote: > > We run a lot of automated tests when building our software and run into > > OOM scenarios when the tests run unbounded. v1 memcg exports > > memcg->watermark as "memory.max_usage_in_bytes" in sysfs. We use this > > metric to heuristically limit the number of tests that can run in > > parallel based on per test historical data. > > > > This metric is currently not exported for v2 memcg and there is no > > other easy way of getting this information. getrusage() syscall returns > > "ru_maxrss" which can be used as an approximation but that's the max > > RSS of a single child process across all children instead of the > > aggregated max for all child processes. The only work around is to > > periodically poll "memory.current" but that's not practical for > > short-lived one-off cgroups. > > > > Hence, expose memcg->watermark as "memory.peak" for v2 memcg. > > It'll save some future indirections if the commit messages includes the > argument about multiple readers and purposeful irresetability. Good point. The patch has already been picked up for mm-unstable. I don't know what's the process in this situation. Should I post a "[PATCH v3]" with an updated commit message? > > > > > Signed-off-by: Ganesan Rajagopal > > --- > > Documentation/admin-guide/cgroup-v2.rst | 7 +++++++ > > mm/memcontrol.c | 13 +++++++++++++ > > 2 files changed, 20 insertions(+) > > Besides that it looks useful and correct, feel free to add > Reviewed-by: Michal Koutn=C3=BD Thank you. Ganesan