From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vasily Averin Subject: [PATCH v2 6/8] memcg: accounting for mnt_cache entries Date: Mon, 15 Mar 2021 15:23:44 +0300 Message-ID: <9ccfd80e-5c38-5dd8-7d05-9226a722f440@virtuozzo.com> References: Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eJk519X8QJk9kT6eYCL7kFmjyTh/WBJuliX1U/YIvXg=; b=D0RT5n2q18yLf3o7qSQJPllGCF24RmI+LTa4FD9t7PHCDZaGo/NxfFNj9PN7Cb9Zwaxe793XwxblVBthP6SvmcxEIKT2n6V2OGlS3tbk7qqI/eZBSmwDVFI3LslXpdeKR+w1hvB/UTZ4AC8RxBOMNZFQ+1tzJ9siMeoXtVQHFW0= In-Reply-To: Content-Language: en-US List-ID: Content-Type: text/plain; charset="us-ascii" To: cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Michal Hocko Cc: linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, Johannes Weiner , Vladimir Davydov , Shakeel Butt , Alexander Viro Each mount inside memcg-limited container creates non-accounted mount object, each new mount namespace allocates lot of them for cloned mounts. --- fs/namespace.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/namespace.c b/fs/namespace.c index 56bb5a5..d550c2a 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -203,7 +203,8 @@ static struct mount *alloc_vfsmnt(const char *name) goto out_free_cache; if (name) { - mnt->mnt_devname = kstrdup_const(name, GFP_KERNEL); + mnt->mnt_devname = kstrdup_const(name, + GFP_KERNEL_ACCOUNT); if (!mnt->mnt_devname) goto out_free_id; } @@ -4213,7 +4214,7 @@ void __init mnt_init(void) int err; mnt_cache = kmem_cache_create("mnt_cache", sizeof(struct mount), - 0, SLAB_HWCACHE_ALIGN | SLAB_PANIC, NULL); + 0, SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_ACCOUNT, NULL); mount_hashtable = alloc_large_system_hash("Mount-cache", sizeof(struct hlist_head), -- 1.8.3.1