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 24400C433EF for ; Sun, 10 Jul 2022 18:53:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2C9598E0001; Sun, 10 Jul 2022 14:53:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 278106B0072; Sun, 10 Jul 2022 14:53:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 13FAE8E0001; Sun, 10 Jul 2022 14:53:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 02DA66B0071 for ; Sun, 10 Jul 2022 14:53:39 -0400 (EDT) Received: from smtpin31.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id C290C33EC6 for ; Sun, 10 Jul 2022 18:53:38 +0000 (UTC) X-FDA: 79672088916.31.0D5F97B Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) by imf15.hostedemail.com (Postfix) with ESMTP id 5C492A0058 for ; Sun, 10 Jul 2022 18:53:37 +0000 (UTC) Received: by mail-lf1-f41.google.com with SMTP id e12so5501517lfr.6 for ; Sun, 10 Jul 2022 11:53:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz-org.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=MjnWXdJX+ay9kx38kvyoZNCAXjqkrOK+MR+sD5e42MA=; b=cCAnTvGpgv1VOxq4QkKFQPUKm0OlnZAicTALdTpQkPW6ZkfzK5lfFKgErveXFEI1Wd MpatJxtSvCVNb95GYpikEYkKUaEBzwBkS6TTqh+P+ByzCWcD91l/slOwCYBvcoyDdiMP 5U32Dk4It78u4TtWOvdC+Q2jefWz2Al03roAtnxw6M9T7VrkgpbUXJTLFdFHU5zpxEF1 5MGKdk5/L6AomK9B5OhwJK0Oru6FNGSTj+8GrmvdRjVKZ3n4gqdRSpQTiCYNkpw1E2I4 8nE96IEzRTQRZEDAwq0erFlfDJd8w6p28D+5kWQ5nF3YFdUXUoSQCpFFdkEIxGT0n0kb JaPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=MjnWXdJX+ay9kx38kvyoZNCAXjqkrOK+MR+sD5e42MA=; b=WM9nF5W8exrneR+zTF9XLLJzRCnAoeXJ9ZBjC2Kd+nfXXz5+Kegb0vxQCcaA7PZ2G4 mbybhhHTiZ/aB5eA0FCBnuCXAD8sxerirH9pxORY8hR9LCoHHm1qcs61T9lYY60vuWfG SBLTvtm58987Hc/rVDP90BQyGG7PM+LzPyR+xxlvh8E1RpmAi1FjbfmIUiGx0v2XFicw i405LV5MY2GM0ePglTt8gm4oyn2QlWz8uiZZRuPt/xjtSiuEPjWhY7ZOaw5jV8TgEF2o VdmulRkHhPhdbTdwZfJCT9Fua5p/gzxkrh10RsjbzLUjowFGvQL2JD93Y2GZHLxBBzdD s28Q== X-Gm-Message-State: AJIora99bJJKt+MJF2nFUrVssvFBa3x6bTTCeiNFgiZUmVmyDljSnDW4 GVBHoEWlCJijmZI7USWRl8IhPw== X-Google-Smtp-Source: AGRyM1uya0WGuv+8UUTsP18UtqUbrCvMhNHmF2mxy6w3S1UINsH8YvDnWNIxXJgNYXN1MAa0V+9leQ== X-Received: by 2002:a05:6512:3f12:b0:47f:51de:d067 with SMTP id y18-20020a0565123f1200b0047f51ded067mr9074357lfa.146.1657479215403; Sun, 10 Jul 2022 11:53:35 -0700 (PDT) Received: from [192.168.1.65] ([46.188.121.143]) by smtp.gmail.com with ESMTPSA id o19-20020ac24e93000000b004793b9c2c12sm837853lfr.124.2022.07.10.11.53.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 10 Jul 2022 11:53:34 -0700 (PDT) Message-ID: <1a64fc6a-a33d-03f4-ec12-980e42148061@openvz.org> Date: Sun, 10 Jul 2022 21:53:34 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH mm v5 0/9] memcg: accounting for objects allocated by mkdir, cgroup Content-Language: en-US To: Michal Hocko , Shakeel Butt Cc: kernel@openvz.org, Andrew Morton , LKML , Linux MM , Roman Gushchin , =?UTF-8?Q?Michal_Koutn=c3=bd?= , Vlastimil Babka , Muchun Song , Cgroups References: <4e685057-b07d-745d-fdaa-1a6a5a681060@openvz.org> <0fe836b4-5c0f-0e32-d511-db816d359748@openvz.org> From: Vasily Averin In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1657479217; a=rsa-sha256; cv=none; b=dEDSLf3PQBOFjtGGJWmaFYC6ZYU4CzLHe95gI55LrHHwG2/KHDUYDZfCF6BBF6R/+Fgf+N ORnuJu3LjRNfj6M1Vc4pUlh+/PfLfY/oFBnqkOsH2inJhonW/r6wAnibUOH1agaAwR4i0r h0XFI8/jLdU5Kj2uy1ACrOTqO1r0710= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1657479217; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=MjnWXdJX+ay9kx38kvyoZNCAXjqkrOK+MR+sD5e42MA=; b=q+EkQeLbR2bVL9JqrhSbasjsX8dr5W0FOo8Me6KVU0yYVxAQ8QcxNo3s50zU+ZS5IC3k29 npK9TNQ19S7UkkYl6DXLGMWRJXdT/qvxS98hDhGQaBy1QmTyDsI/YmA5cnTa0IvWyIhR2e K6AgZzzRYEQHXz9XUGCN3GYe6Kre7bY= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=openvz-org.20210112.gappssmtp.com header.s=20210112 header.b=cCAnTvGp; dmarc=pass (policy=none) header.from=openvz.org; spf=pass (imf15.hostedemail.com: domain of vvs@openvz.org designates 209.85.167.41 as permitted sender) smtp.mailfrom=vvs@openvz.org Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=openvz-org.20210112.gappssmtp.com header.s=20210112 header.b=cCAnTvGp; dmarc=pass (policy=none) header.from=openvz.org; spf=pass (imf15.hostedemail.com: domain of vvs@openvz.org designates 209.85.167.41 as permitted sender) smtp.mailfrom=vvs@openvz.org X-Rspamd-Server: rspam03 X-Stat-Signature: cmsft94id4wx1aiyfa5yo36bcj5seka4 X-Rspamd-Queue-Id: 5C492A0058 X-Rspam-User: X-HE-Tag: 1657479217-999841 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 7/1/22 14:03, Michal Hocko wrote: > On Mon 27-06-22 09:37:14, Shakeel Butt wrote: >> On Fri, Jun 24, 2022 at 6:59 AM Michal Hocko wrote: > [...] >>> 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. > > Considering the amount of memory and "normal" cgroup usage (I guess we > can agree that delegated subtrees do not count their cgroups in > thousands) is this really something that is worth bothering with? > > I mean, these patches are really small and not really disruptive so I do > not really see any problem with them. Except that they clearly add a > maintenance overhead. Not directly with the memory they track but any > future cgroup/memcg metadata related objects would need to be tracked as > well and I am worried this will get quickly out of sync. So we will have > a half assed solution in place that doesn't really help any containment > nor it provides a good and robust consumption tracking. > > All that being said I find these changes rather without a great value or > use. Dear Michal, I sill have 2 questions: 1) if you do not want to account any memory allocated for cgroup objects, should you perhaps revert commit 3e38e0aaca9e "mm: memcg: charge memcg percpu memory to the parent cgroup". Is it an exception perhaps? (in fact I hope you will not revert this patch, I just would like to know your explanations about this accounting) 2) my patch set includes kernfs accounting required for proper netdevices accounting Allocs Alloc Allocation number size -------------------------------------------- 1 + 128 (__kernfs_new_node+0x4d) kernfs node 1 + 88 (__kernfs_iattrs+0x57) kernfs iattrs 1 + 96 (simple_xattr_alloc+0x28) simple_xattr, can grow over 4Kb 1 32 (simple_xattr_set+0x59) 1 8 (__kernfs_new_node+0x30) 2/9] memcg: enable accounting for kernfs nodes 3/9] memcg: enable accounting for kernfs iattrs 4/9] memcg: enable accounting for struct simple_xattr What do you think about them? Should I resend them as a new separate patch set? Thank you, Vasily Averin