[lkml]   [2017]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] mm/shmem: set default tmpfs size according to memcg limit
2017-11-20 20:04 GMT+08:00 Michal Hocko <>:
> On Fri 17-11-17 09:49:54, Shakeel Butt wrote:
>> On Fri, Nov 17, 2017 at 9:41 AM, Yafang Shao <> wrote:
> [...]
>> > Of couse that is the best way.
>> > But we can not ensue all applications will do it.
>> > That's why I introduce a proper defalut value for them.
>> >
>> I think we disagree on the how to get proper default value. Unless you
>> can restrict that all the memory allocated for a tmpfs mount will be
>> charged to a specific memcg, you should not just pick limit of the
>> memcg of the process mounting the tmpfs to set the default of tmpfs
>> mount. If you can restrict tmpfs charging to a specific memcg then the
>> limit of that memcg should be used to set the default of the tmpfs
>> mount. However this feature is not present in the upstream kernel at
>> the moment (We have this feature in our local kernel and I am planning
>> to upstream that).
> I think the whole problem is that containers pretend to be independent
> while they share a non-reclaimable resource. Fix this and you will not
> have a problem. I am afraid that the only real fix is to make tmpfs
> private per container instance and that is something you can easily
> achieve in the userspace.

Agree with you.

Introduce tmpfs stat in memory cgroup, something like

IMHO this is the best solution.


 \ /
  Last update: 2017-11-20 13:16    [W:0.058 / U:5.876 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site