Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3136649iog; Mon, 27 Jun 2022 09:52:59 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tlV01gpZb0YvAbHe9ikNGH/Fy0jhUL4KipZC53EIgP2mjVdVQn16ZYahEygt0Y4FCAtCo8 X-Received: by 2002:a05:6402:1219:b0:437:74dd:640d with SMTP id c25-20020a056402121900b0043774dd640dmr14369893edw.312.1656348779011; Mon, 27 Jun 2022 09:52:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656348779; cv=none; d=google.com; s=arc-20160816; b=ycrwo2i85LAI342C8KHMhGfCopQIdNKawZZB0Wl/YjutcYN5EPNztngRv8r3SFgn7y Q0QvvSo2RLqm9/pVtqwWkNuSmNZDfsYw0ha0XU4JJIKFhSsarxui3AlP3M9Cwdv2hcpr Z6iwhMHccHxRXFJ7zl/XYTsADOidO28+GRJ6u02M98deT5+PHUBFBUep6TDL01JWYHYG cMIY0jpow72s+SPxOCLzX2s8ymdiKK4ilWymluzKcv7HympztB7X6JaJ5j9vmzE2nClP XpWpsC7Q67obpYltS7y+MVZ/REDf6ocNXzF/Hj+Zu/fEFk3Jkag1r31Rv8IUapNzUamA 34Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=M2vRONC13amhSE1W+iisI+raE+PvPU52ESA4pnszZg8=; b=dfur00tmy+qK0HgJmt0X7PtZxPjQmeFC9OhvaphsbzkY2usAEU99oPj3OfGqquxNS2 PwwfFLNfITdrpHVxiIXR6tXHK0bo5sKLaPiZ5HUrU33eDbo4Td78kIuaE7Bo62pY/l8A qtEzZXvPm3Y9Y6duobP1Lw4lpnuq4s1sJoiWDBbvNPdTufdeMChHlAHfTQ+s4jFC130n poQlRFreA8iW53BMtg2jPelQ/BfCZPqK6gB20hLNla3z7RTIsFdWaGBdEhhEMoVjmssJ KvvVighMZolvs0ChTfEgWiYofNVLnOqdMsdy09VArmXRYh4w7oq565lterTM1urfyVfb +0LQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=UEcpkmCq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ga28-20020a1709070c1c00b00726abda6121si2969317ejc.533.2022.06.27.09.52.34; Mon, 27 Jun 2022 09:52:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=UEcpkmCq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239564AbiF0Qhd (ORCPT + 99 others); Mon, 27 Jun 2022 12:37:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239545AbiF0Qh2 (ORCPT ); Mon, 27 Jun 2022 12:37:28 -0400 Received: from mail-yb1-xb33.google.com (mail-yb1-xb33.google.com [IPv6:2607:f8b0:4864:20::b33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 829671114B for ; Mon, 27 Jun 2022 09:37:26 -0700 (PDT) Received: by mail-yb1-xb33.google.com with SMTP id p136so11487539ybg.4 for ; Mon, 27 Jun 2022 09:37:26 -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=M2vRONC13amhSE1W+iisI+raE+PvPU52ESA4pnszZg8=; b=UEcpkmCqZthqdDmCcJb/GHcW0WYvQnSCthVpaKsdmJhtGXLqN7CSupnYP/T9EPiFCT dpWNdyhfR++Q5OkhmkqsGWC8xP+zsLjqe1hZEPiTRDPwzXUixzZdYN+OrQiKxHD6+YND syqoKAJUsXT0A6UFFYH6qKrCaYiRvAEakeCdLDH8ogsyCp24jeLat9pAf8A3f5Kaa916 Ne+P4JzkAkzuD8jViCtMZRJ9dzBpqQSf0OwuZA8SljXz57Vy4S+6COF26L6Jk7HDX7m7 cflaOdwbvTx9eRoOi8K6EYa7WK7WZCXi9s387y7i3owFFtCUK9XdXU/EVohHplY0b3pr tt2w== 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=M2vRONC13amhSE1W+iisI+raE+PvPU52ESA4pnszZg8=; b=brSwXHfmoXrb5XM3KBziBYyPN4+4NlRTMWbtHUYfzrLK1uSeQJz4RHoE7lRAJ8JT6C WqWOP4w6zAx6rgAg1AevzgOLScfewI5GS93c7ZBb9QnOvodJZm4I9W+Jf/Iq1wE13DQf +pIjXnkgfJOik1l/rmDcHvSYhsjhsU5+wOdhD4x1AT+fx1hSi472FXYG60G9H0UZREWx Wc9xQER9AIXcbMS613jxV8Ozo/LoJxmbicvTtW3IZu75/U+fkjeypxDDbnpeaD2Eo/u0 vZorigfI08kRpGrMAhNXgJU8B9APKrxYo86m9uDygnMo3k+r2YP2bv2hoWN8H770HlGc /Seg== X-Gm-Message-State: AJIora9rtBmsqR/Kwrxwxuxh2ymHfVQCFF4ZcCXeizTRjTKwOjXat4Jh RgHwg212Tj7rDsrKrA9+XX8LletmG1uXUMdGjVinmg== X-Received: by 2002:a25:83cf:0:b0:66b:c7e5:faf with SMTP id v15-20020a2583cf000000b0066bc7e50fafmr14517036ybm.288.1656347845647; Mon, 27 Jun 2022 09:37:25 -0700 (PDT) MIME-Version: 1.0 References: <4e685057-b07d-745d-fdaa-1a6a5a681060@openvz.org> <0fe836b4-5c0f-0e32-d511-db816d359748@openvz.org> In-Reply-To: From: Shakeel Butt Date: Mon, 27 Jun 2022 09:37:14 -0700 Message-ID: Subject: Re: [PATCH mm v5 0/9] memcg: accounting for objects allocated by mkdir, cgroup To: Michal Hocko Cc: Vasily Averin , kernel@openvz.org, Andrew Morton , LKML , Linux MM , Roman Gushchin , =?UTF-8?Q?Michal_Koutn=C3=BD?= , Vlastimil Babka , Muchun Song , Cgroups Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 24, 2022 at 6:59 AM Michal Hocko wrote: > > On Thu 23-06-22 09:55:33, Shakeel Butt wrote: > > On Thu, Jun 23, 2022 at 9:07 AM Michal Hocko wrote: > > > > > > On Thu 23-06-22 18:03:31, Vasily Averin wrote: > > > > Dear Michal, > > > > do you still have any concerns about this patch set? > > > > > > Yes, I do not think we have concluded this to be really necessary. IIRC > > > Roman would like to see lingering cgroups addressed in not-so-distant > > > future (http://lkml.kernel.org/r/Ypd2DW7id4M3KJJW@carbon) and we already > > > have a limit for the number of cgroups in the tree. So why should we > > > chase after allocations that correspond the cgroups and somehow try to > > > cap their number via the memory consumption. This looks like something > > > that will get out of sync eventually and it also doesn't seem like the > > > best control to me (comparing to an explicit limit to prevent runaways). > > > -- > > > > Let me give a counter argument to that. On a system running multiple > > workloads, how can the admin come up with a sensible limit for the > > number of cgroups? > > How is that any easier through memory consumption? Something that might > change between kernel versions? In v2, we do provide a way for admins to right size the containers without killing them. Actually we are trying to use memory.high for right sizing the jobs. (It is not the best but workable and there are opportunities to improve it). Similar mechanisms for other types of limits are lacking. Usually the application would be getting the error for which it can not do anything most of the time. > Is it even possible to prevent from id > depletion by the memory consumption? Any medium sized memcg can easily > consume all the ids AFAICS. Though the patch series is pitched as protection against OOMs, I think it is beneficial irrespective. Protection against an adversarial actor should not be the aim here. IMO this patch series improves the memory association to the actual user which is better than unattributed memory treated as system overhead.