lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YHfjMyJuvXzJsg6T@dhcp22.suse.cz>
Date:   Thu, 15 Apr 2021 08:54:43 +0200
From:   Michal Hocko <mhocko@...e.com>
To:     Bharata B Rao <bharata@...ux.ibm.com>
Cc:     Dave Chinner <david@...morbit.com>, akpm@...ux-foundation.org,
        linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        linux-fsdevel@...r.kernel.org, aneesh.kumar@...ux.ibm.com
Subject: Re: High kmalloc-32 slab cache consumption with 10k containers

On Thu 15-04-21 10:53:00, Bharata B Rao wrote:
> On Wed, Apr 07, 2021 at 08:28:07AM +1000, Dave Chinner wrote:
> > 
> > Another approach may be to identify filesystem types that do not
> > need memcg awareness and feed that into alloc_super() to set/clear
> > the SHRINKER_MEMCG_AWARE flag. This could be based on fstype - most
> > virtual filesystems that expose system information do not really
> > need full memcg awareness because they are generally only visible to
> > a single memcg instance...
> 
> Would something like below be appropriate?

No. First of all you are defining yet another way to say
SHRINKER_MEMCG_AWARE which is messy. And secondly why would shmem, proc
and ramfs be any special and they would be ok to opt out? There is no
single word about that reasoning in your changelog.

> >From f314083ad69fde2a420a1b74febd6d3f7a25085f Mon Sep 17 00:00:00 2001
> From: Bharata B Rao <bharata@...ux.ibm.com>
> Date: Wed, 14 Apr 2021 11:21:24 +0530
> Subject: [PATCH 1/1] fs: Let filesystems opt out of memcg awareness
> 
> All filesystem mounts by default are memcg aware and end hence
> end up creating shrinker list_lrus for all the memcgs. Due to
> the way the memcg_nr_cache_ids grow and the list_lru heads are
> allocated for all memcgs, huge amount of memory gets consumed
> by kmalloc-32 slab cache when running thousands of containers.
> 
> Improve this situation by allowing filesystems to opt out
> of memcg awareness. In this patch, tmpfs, proc and ramfs
> opt out of memcg awareness. This leads to considerable memory
> savings when running 10k containers.
> 
> Signed-off-by: Bharata B Rao <bharata@...ux.ibm.com>
> ---
>  fs/proc/root.c             |  1 +
>  fs/ramfs/inode.c           |  1 +
>  fs/super.c                 | 27 +++++++++++++++++++--------
>  include/linux/fs_context.h |  2 ++
>  mm/shmem.c                 |  1 +
>  5 files changed, 24 insertions(+), 8 deletions(-)

[...]
-- 
Michal Hocko
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ