Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4613676ioa; Wed, 27 Apr 2022 07:30:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxaMSxeuXXyrNKdBsrGAcRaPTMuwNOC6Wp4Xx3KnKtphlhaN9wvCpOdHm0fPsEqJCZK/H5G X-Received: by 2002:a9d:644b:0:b0:5cd:a627:c439 with SMTP id m11-20020a9d644b000000b005cda627c439mr10043975otl.112.1651069830271; Wed, 27 Apr 2022 07:30:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651069830; cv=none; d=google.com; s=arc-20160816; b=jTDIYsaE+47FmVaeE5T1r210XUJuZj1E8z4Nex3XvZA2gF9+wDmIEPHKdRRsxNhPZs Blaq11DevqQ6wgVwiP42MywnjeBfqfQh3LVwOYIwUh0LJf34sBfZuPzib0ulZ5azV0dr iQSPYMF7d6NtXyJ54hmtkUF7WeQ1efK+qd8vP+xRNr2MT9Kyq1iw4a1+VwYbuQXK0DCT cV4UyEkdbnf2yZ0I0EYwFjGeL926FuybW8HAWCfmRPiNz2eN38sf8FKl+81bGGRb2A60 5sm/JxsrEZx/uX7EFPMhA05KtmjpHUtDY6xmHH7NdoGuBvppCYl8DgTjb/bdNv7vL7x1 xcFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=rtEd6e1tTShJTnCJcYs65RbsArilbR2cAspTgrMECHg=; b=DNnh9i3tiA+4boeBYXhNZ4nx7gVubBa4/fe7/8qbggb907vq7ZyCQrmnxCNUqTvaCQ 1oWyzWkaEZqILQzy8/+sZrsa5Wr0XK3QTqiTjSW5DsuuEq9EK8HLzF8zNjPzpbqNvApC 5Kj/csEbisbafCS7pQ2O85ERM9g7d9Kf27wDQNKhhcJprG6oeGc6QO6w4g8xP81YnNcS 5vYyaG0ObMpgH+GXSfsjoZRBBjp6ICgSmdZEX6J5aylQkEMNj2JVbqb4w3sLJHxlEIyv erndz3uwwZ2n90EroriUtsf4CvNyPdCcycVkGgj/mUjDir00RDCkwH2Q7LluwPYu0KMt jjzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=InPtbRKy; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id c16-20020a9d6c90000000b005cd8c155791si933604otr.176.2022.04.27.07.30.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 07:30:30 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=InPtbRKy; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9EF994831D; Wed, 27 Apr 2022 07:02:12 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237350AbiD0OFK (ORCPT + 99 others); Wed, 27 Apr 2022 10:05:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237151AbiD0OFH (ORCPT ); Wed, 27 Apr 2022 10:05:07 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F0D847ACA; Wed, 27 Apr 2022 07:01:56 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id DC01C1F37B; Wed, 27 Apr 2022 14:01:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1651068114; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=rtEd6e1tTShJTnCJcYs65RbsArilbR2cAspTgrMECHg=; b=InPtbRKyqPnLyRc4lNpBPdIgoPKrVjYvlGinsX0swe8z63mZmZLe+hjtuQVEEBmBMWafjh aQ2Bges0I0+i4O+uhCH5nABzz41ag5HpDK76UpUhk5JJtaWIIrh6PjmvD2cO5EizQEXU7M sRVuQIiTePcpSjg7K8BV/a7Wo+iGgD8= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 82A5713A39; Wed, 27 Apr 2022 14:01:54 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id KJHuHtJMaWKCagAAMHmgww (envelope-from ); Wed, 27 Apr 2022 14:01:54 +0000 Date: Wed, 27 Apr 2022 16:01:53 +0200 From: Michal =?iso-8859-1?Q?Koutn=FD?= To: Vasily Averin Cc: Roman Gushchin , Vlastimil Babka , Shakeel Butt , kernel@openvz.org, Florian Westphal , linux-kernel@vger.kernel.org, Michal Hocko , cgroups@vger.kernel.org, netdev@vger.kernel.org, "David S. Miller" , Jakub Kicinski , Paolo Abeni , Greg Kroah-Hartman , Tejun Heo , Luis Chamberlain , Kees Cook , Iurii Zaikin , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH] memcg: accounting for objects allocated for new netdevice Message-ID: <20220427140153.GC9823@blackbody.suse.cz> References: <7e867cb0-89d6-402c-33d2-9b9ba0ba1523@openvz.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7e867cb0-89d6-402c-33d2-9b9ba0ba1523@openvz.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=no 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 Hello Vasily. On Wed, Apr 27, 2022 at 01:37:50PM +0300, Vasily Averin wrote: > diff --git a/fs/kernfs/mount.c b/fs/kernfs/mount.c > index cfa79715fc1a..2881aeeaa880 100644 > --- a/fs/kernfs/mount.c > +++ b/fs/kernfs/mount.c > @@ -391,7 +391,7 @@ void __init kernfs_init(void) > { > kernfs_node_cache = kmem_cache_create("kernfs_node_cache", > sizeof(struct kernfs_node), > - 0, SLAB_PANIC, NULL); > + 0, SLAB_PANIC | SLAB_ACCOUNT, NULL); kernfs accounting you say? kernfs backs up also cgroups, so the parent-child accounting comes to my mind. See the temporary switch to parent memcg in mem_cgroup_css_alloc(). (I mean this makes some sense but I'd suggest unlumping the kernfs into a separate path for possible discussion and its not-only-netdevice effects.) Thanks, Michal