Re: [PATCH] mm/shmem: set default tmpfs size according to memcg limit

2017-11-20 Thread Yafang Shao
2017-11-20 20:39 GMT+08:00 Michal Hocko : > On Mon 20-11-17 20:16:15, Yafang Shao wrote: >> 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. >> >>

Re: [PATCH] mm/shmem: set default tmpfs size according to memcg limit

2017-11-20 Thread Michal Hocko
On Mon 20-11-17 20:16:15, Yafang Shao wrote: > 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 i

Re: [PATCH] mm/shmem: set default tmpfs size according to memcg limit

2017-11-20 Thread Yafang Shao
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

Re: [PATCH] mm/shmem: set default tmpfs size according to memcg limit

2017-11-20 Thread 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

Re: [PATCH] mm/shmem: set default tmpfs size according to memcg limit

2017-11-17 Thread Yafang Shao
2017-11-18 1:49 GMT+08:00 Shakeel Butt : > On Fri, Nov 17, 2017 at 9:41 AM, Yafang Shao wrote: >> 2017-11-18 1:35 GMT+08:00 Shakeel Butt : >>> On Fri, Nov 17, 2017 at 9:09 AM, Yafang Shao wrote: 2017-11-18 0:45 GMT+08:00 Roman Gushchin : > On Sat, Nov 18, 2017 at 12:20:40AM +0800, Yafang

Re: [PATCH] mm/shmem: set default tmpfs size according to memcg limit

2017-11-17 Thread Shakeel Butt
On Fri, Nov 17, 2017 at 9:41 AM, Yafang Shao wrote: > 2017-11-18 1:35 GMT+08:00 Shakeel Butt : >> On Fri, Nov 17, 2017 at 9:09 AM, Yafang Shao wrote: >>> 2017-11-18 0:45 GMT+08:00 Roman Gushchin : On Sat, Nov 18, 2017 at 12:20:40AM +0800, Yafang Shao wrote: > 2017-11-17 23:55 GMT+08:00 R

Re: [PATCH] mm/shmem: set default tmpfs size according to memcg limit

2017-11-17 Thread Yafang Shao
2017-11-18 1:35 GMT+08:00 Shakeel Butt : > On Fri, Nov 17, 2017 at 9:09 AM, Yafang Shao wrote: >> 2017-11-18 0:45 GMT+08:00 Roman Gushchin : >>> On Sat, Nov 18, 2017 at 12:20:40AM +0800, Yafang Shao wrote: 2017-11-17 23:55 GMT+08:00 Roman Gushchin : > On Thu, Nov 16, 2017 at 08:43:17PM -

Re: [PATCH] mm/shmem: set default tmpfs size according to memcg limit

2017-11-17 Thread Shakeel Butt
On Fri, Nov 17, 2017 at 9:09 AM, Yafang Shao wrote: > 2017-11-18 0:45 GMT+08:00 Roman Gushchin : >> On Sat, Nov 18, 2017 at 12:20:40AM +0800, Yafang Shao wrote: >>> 2017-11-17 23:55 GMT+08:00 Roman Gushchin : >>> > On Thu, Nov 16, 2017 at 08:43:17PM -0800, Shakeel Butt wrote: >>> >> On Thu, Nov 16

Re: [PATCH] mm/shmem: set default tmpfs size according to memcg limit

2017-11-17 Thread Yafang Shao
2017-11-18 0:45 GMT+08:00 Roman Gushchin : > On Sat, Nov 18, 2017 at 12:20:40AM +0800, Yafang Shao wrote: >> 2017-11-17 23:55 GMT+08:00 Roman Gushchin : >> > On Thu, Nov 16, 2017 at 08:43:17PM -0800, Shakeel Butt wrote: >> >> On Thu, Nov 16, 2017 at 7:09 PM, Yafang Shao wrote: >> >> > Currently th

Re: [PATCH] mm/shmem: set default tmpfs size according to memcg limit

2017-11-17 Thread Roman Gushchin
On Sat, Nov 18, 2017 at 12:20:40AM +0800, Yafang Shao wrote: > 2017-11-17 23:55 GMT+08:00 Roman Gushchin : > > On Thu, Nov 16, 2017 at 08:43:17PM -0800, Shakeel Butt wrote: > >> On Thu, Nov 16, 2017 at 7:09 PM, Yafang Shao wrote: > >> > Currently the default tmpfs size is totalram_pages / 2 if mou

Re: [PATCH] mm/shmem: set default tmpfs size according to memcg limit

2017-11-17 Thread Yafang Shao
2017-11-17 23:55 GMT+08:00 Roman Gushchin : > On Thu, Nov 16, 2017 at 08:43:17PM -0800, Shakeel Butt wrote: >> On Thu, Nov 16, 2017 at 7:09 PM, Yafang Shao wrote: >> > Currently the default tmpfs size is totalram_pages / 2 if mount tmpfs >> > without "-o size=XXX". >> > When we mount tmpfs in a co

Re: [PATCH] mm/shmem: set default tmpfs size according to memcg limit

2017-11-17 Thread Roman Gushchin
On Thu, Nov 16, 2017 at 08:43:17PM -0800, Shakeel Butt wrote: > On Thu, Nov 16, 2017 at 7:09 PM, Yafang Shao 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_page

Re: [PATCH] mm/shmem: set default tmpfs size according to memcg limit

2017-11-16 Thread Yafang Shao
2017-11-17 12:43 GMT+08:00 Shakeel Butt : > On Thu, Nov 16, 2017 at 7:09 PM, Yafang Shao 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

Re: [PATCH] mm/shmem: set default tmpfs size according to memcg limit

2017-11-16 Thread Shakeel Butt
On Thu, Nov 16, 2017 at 7:09 PM, Yafang Shao 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 easil

[PATCH] mm/shmem: set default tmpfs size according to memcg limit

2017-11-16 Thread Yafang Shao
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.