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: <20171117155509.GA920@castle>
Date:   Fri, 17 Nov 2017 15:55:16 +0000
From:   Roman Gushchin <guro@...com>
To:     Shakeel Butt <shakeelb@...gle.com>
CC:     Yafang Shao <laoar.shao@...il.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Johannes Weiner <hannes@...xchg.org>,
        Vladimir Davydov <vdavydov.dev@...il.com>,
        Michal Hocko <mhocko@...e.com>, Tejun Heo <tj@...nel.org>,
        <khlebnikov@...dex-team.ru>, <mka@...omium.org>,
        Hugh Dickins <hughd@...gle.com>,
        Cgroups <cgroups@...r.kernel.org>, Linux MM <linux-mm@...ck.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mm/shmem: set default tmpfs size according to memcg limit

On Thu, Nov 16, 2017 at 08:43:17PM -0800, Shakeel Butt wrote:
> On Thu, Nov 16, 2017 at 7:09 PM, Yafang Shao <laoar.shao@...il.com> wrote:
> > Currently the default tmpfs size is totalram_pages / 2 if mount tmpfs
> > without "-o size=XXX".
> > When we mount tmpfs in a container(i.e. docker), it is also
> > totalram_pages / 2 regardless of the memory limit on this container.
> > That may easily cause OOM if tmpfs occupied too much memory when swap is
> > off.
> > So when we mount tmpfs in a memcg, the default size should be limited by
> > the memcg memory.limit.
> >
> 
> The pages of the tmpfs files are charged to the memcg of allocators
> which can be in memcg different from the memcg in which the mount
> operation happened. So, tying the size of a tmpfs mount where it was
> mounted does not make much sense.

Also, memory limit is adjustable, and using a particular limit value
at a moment of tmpfs mounting doesn't provide any warranties further.

Is there a reason why the userspace app which is mounting tmpfs can't
set the size based on memory.limit?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ