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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4C76AC433FE for ; Wed, 27 Apr 2022 14:02:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237352AbiD0OFM (ORCPT ); Wed, 27 Apr 2022 10:05:12 -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) 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