Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp2678476imw; Sun, 10 Jul 2022 12:24:19 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tl+6HFC7JFVgtbRTwdJlnjFYiTlqUmlt3kbXQrHQQC2F/1RQKHLKr2WHPEdE2y5RDxz0jL X-Received: by 2002:a17:907:2714:b0:72b:3e5b:d4d8 with SMTP id w20-20020a170907271400b0072b3e5bd4d8mr7427045ejk.268.1657481059006; Sun, 10 Jul 2022 12:24:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657481059; cv=none; d=google.com; s=arc-20160816; b=ExOwnnZlIHSdgBB4FVhI6h8LZOf/zjuqFr4b4wQVzeq2TPceyzeYK6DFhXvVJ3r09U cvPAKXSv7qHKFHOV2LBHcNzvuKQMSw+YuZg1pNeOBQY98i6fU8WB6sRTqUFSU/5HjpTP P7kJcs35i6YYWgfenHhV2gcoDTNMQF0g2LwLbDFkq/2zm4eyYl548CEU3q6VijbaDHo8 opUpHCSU8tiD3+5u98hGU19TriW65O8XzH7njzhY8l9ZxTHP/ZAj8x/+fqhAH2EEov6O 6RpWXmhUQbuRb2Ai94rTP8TZJ+asT9e2sRe3b56dBQ7TgxXASj6y+nGxU2/esIvGul9D mSHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=MjnWXdJX+ay9kx38kvyoZNCAXjqkrOK+MR+sD5e42MA=; b=gDLN2OEdByevOaYncV9BwVUe9eio7uWtQGlK8Nm2FeMhKWcqmc2gHShu2f+9lpAu2Q Ut8MfwZCkQjzMaHKWBaAv9NnZ/aJSJ1rBKDwQOIGCLBlsxdv/XqlfskNV5+kJtiJvJTZ WYmsaFggfn3Yh4M7y/Z6PdAMP6zaODIXBBMXnel4nuynKhzKl2Ybm2/GyvwWbOfLENI6 k/wovPqY+z0Mx1cKMpRj+E/iKWbjWYDaaxrgQrDQxMMzvEvo1UzeVtrnKeeQvh7gY9V0 qiVMnPLPjzkaTx42ig4vqGJRZvg4FjHltJRtlI0izwV0m12tYMf4hN8OHBCf3ymJ0i5K ar/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@openvz-org.20210112.gappssmtp.com header.s=20210112 header.b=cCAnTvGp; 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=fail (p=NONE sp=NONE dis=NONE) header.from=openvz.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sh19-20020a1709076e9300b0072af35fca64si2093015ejc.484.2022.07.10.12.23.52; Sun, 10 Jul 2022 12:24:18 -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=@openvz-org.20210112.gappssmtp.com header.s=20210112 header.b=cCAnTvGp; 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=fail (p=NONE sp=NONE dis=NONE) header.from=openvz.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229535AbiGJSxk (ORCPT + 99 others); Sun, 10 Jul 2022 14:53:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229479AbiGJSxi (ORCPT ); Sun, 10 Jul 2022 14:53:38 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19FE3BC07 for ; Sun, 10 Jul 2022 11:53:37 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id f39so5517248lfv.3 for ; Sun, 10 Jul 2022 11:53:37 -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=M4PF5VbxBtUMw+Oam9z0tUJe7UoZO8Nbs6pWypfzSTcELHg03ZRIvwRtIO8M6Kzm5S xdoHy6GyQ+xtCyXvv9JvtKUWPCtc/Hc0m8YYZ5urkeorfEeZyn4OuvLbEDAFEMK5u4Us OfHYT6jaym2n5J9dH/Z+Dri45FCOrEx5unExlz3oVku4Vl83/kUXbkX6yXq5+e2JNIJs VUKy4zHF7zSSCQUS1i5n0jcqyDL6JBWXJ6uHlInvZvaHLCIw+izR1N4jtk2Bduytx+fe W8q4V0+2aSWXJEUyWifEsdb3Qdq2QfwTNQhd9TEj8j6Qk2H9Bq3Rce6EF2OzrGxrSJlQ u9NQ== X-Gm-Message-State: AJIora8C6iUDyf2h3ONcZkLmIJsbEZvgwzE0NWjBM2i6tGfETbOmzSAD hrKpkayNFM3h6tdETYHe/2EauoEGLmYdNA== 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 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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 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