Re: [PATCH 1/7] mm: memcontrol: charge swap to cgroup2

2015-12-16 Thread Kamezawa Hiroyuki
On 2015/12/17 12:32, Johannes Weiner wrote: On Thu, Dec 17, 2015 at 11:46:27AM +0900, Kamezawa Hiroyuki wrote: On 2015/12/16 20:09, Johannes Weiner wrote: On Wed, Dec 16, 2015 at 12:18:30PM +0900, Kamezawa Hiroyuki wrote: - swap-full notification via vmpressure or something mechanism. Why?

Re: [PATCH 1/7] mm: memcontrol: charge swap to cgroup2

2015-12-16 Thread Johannes Weiner
On Thu, Dec 17, 2015 at 11:46:27AM +0900, Kamezawa Hiroyuki wrote: > On 2015/12/16 20:09, Johannes Weiner wrote: > >On Wed, Dec 16, 2015 at 12:18:30PM +0900, Kamezawa Hiroyuki wrote: > >> - swap-full notification via vmpressure or something mechanism. > > > >Why? > > > > I think it's a sign of un

Re: [PATCH 1/7] mm: memcontrol: charge swap to cgroup2

2015-12-16 Thread Kamezawa Hiroyuki
On 2015/12/16 20:09, Johannes Weiner wrote: On Wed, Dec 16, 2015 at 12:18:30PM +0900, Kamezawa Hiroyuki wrote: Hmm, my requests are - set the same capabilities as mlock() to set swap.limit=0 Setting swap.max is already privileged operation. Sure. - swap-full notification via vmpressure

Re: [PATCH 1/7] mm: memcontrol: charge swap to cgroup2

2015-12-16 Thread Johannes Weiner
On Wed, Dec 16, 2015 at 12:18:30PM +0900, Kamezawa Hiroyuki wrote: > Hmm, my requests are > - set the same capabilities as mlock() to set swap.limit=0 Setting swap.max is already privileged operation. > - swap-full notification via vmpressure or something mechanism. Why? > - OOM-Killer's ava

Re: [PATCH 1/7] mm: memcontrol: charge swap to cgroup2

2015-12-15 Thread Kamezawa Hiroyuki
On 2015/12/16 2:21, Michal Hocko wrote: I completely agree that malicious/untrusted users absolutely have to be capped by the hard limit. Then the separate swap limit would work for sure. But I am less convinced about usefulness of the rigid (to the global memory pressure) swap limit without th

Re: [PATCH 1/7] mm: memcontrol: charge swap to cgroup2

2015-12-15 Thread Kamezawa Hiroyuki
On 2015/12/15 23:50, Johannes Weiner wrote: On Tue, Dec 15, 2015 at 12:22:41PM +0900, Kamezawa Hiroyuki wrote: On 2015/12/15 4:42, Vladimir Davydov wrote: Anyway, if you don't trust a container you'd better set the hard memory limit so that it can't hurt others no matter what it runs and how it

Re: [PATCH 1/7] mm: memcontrol: charge swap to cgroup2

2015-12-15 Thread Kamezawa Hiroyuki
On 2015/12/15 20:02, Vladimir Davydov wrote: On Tue, Dec 15, 2015 at 12:22:41PM +0900, Kamezawa Hiroyuki wrote: On 2015/12/15 4:42, Vladimir Davydov wrote: On Mon, Dec 14, 2015 at 04:30:37PM +0100, Michal Hocko wrote: On Thu 10-12-15 14:39:14, Vladimir Davydov wrote: In the legacy hierarchy w

Re: [PATCH 1/7] mm: memcontrol: charge swap to cgroup2

2015-12-15 Thread Johannes Weiner
On Tue, Dec 15, 2015 at 06:21:28PM +0100, Michal Hocko wrote: > > AFAICS such anon memory protection has a side-effect: real-life > > workloads need page cache to run smoothly (at least for mapping > > executables). Disabling swapping would switch pressure to page caches, > > resulting in performan

Re: [PATCH 1/7] mm: memcontrol: charge swap to cgroup2

2015-12-15 Thread Michal Hocko
On Mon 14-12-15 22:42:58, Vladimir Davydov wrote: > On Mon, Dec 14, 2015 at 04:30:37PM +0100, Michal Hocko wrote: > > On Thu 10-12-15 14:39:14, Vladimir Davydov wrote: > > > In the legacy hierarchy we charge memsw, which is dubious, because: > > > > > > - memsw.limit must be >= memory.limit, so i

Re: [PATCH 1/7] mm: memcontrol: charge swap to cgroup2

2015-12-15 Thread Johannes Weiner
On Tue, Dec 15, 2015 at 12:22:41PM +0900, Kamezawa Hiroyuki wrote: > On 2015/12/15 4:42, Vladimir Davydov wrote: > >Anyway, if you don't trust a container you'd better set the hard memory > >limit so that it can't hurt others no matter what it runs and how it > >tweaks its sub-tree knobs. > > Limi

Re: [PATCH 1/7] mm: memcontrol: charge swap to cgroup2

2015-12-15 Thread Vladimir Davydov
On Tue, Dec 15, 2015 at 12:22:41PM +0900, Kamezawa Hiroyuki wrote: > On 2015/12/15 4:42, Vladimir Davydov wrote: > >On Mon, Dec 14, 2015 at 04:30:37PM +0100, Michal Hocko wrote: > >>On Thu 10-12-15 14:39:14, Vladimir Davydov wrote: > >>>In the legacy hierarchy we charge memsw, which is dubious, bec

Re: [PATCH 1/7] mm: memcontrol: charge swap to cgroup2

2015-12-15 Thread Kamezawa Hiroyuki
On 2015/12/15 17:30, Vladimir Davydov wrote: On Tue, Dec 15, 2015 at 12:12:40PM +0900, Kamezawa Hiroyuki wrote: On 2015/12/15 0:30, Michal Hocko wrote: On Thu 10-12-15 14:39:14, Vladimir Davydov wrote: In the legacy hierarchy we charge memsw, which is dubious, because: - memsw.limit must be

Re: [PATCH 1/7] mm: memcontrol: charge swap to cgroup2

2015-12-15 Thread Vladimir Davydov
On Tue, Dec 15, 2015 at 12:12:40PM +0900, Kamezawa Hiroyuki wrote: > On 2015/12/15 0:30, Michal Hocko wrote: > >On Thu 10-12-15 14:39:14, Vladimir Davydov wrote: > >>In the legacy hierarchy we charge memsw, which is dubious, because: > >> > >> - memsw.limit must be >= memory.limit, so it is imposs

Re: [PATCH 1/7] mm: memcontrol: charge swap to cgroup2

2015-12-14 Thread Kamezawa Hiroyuki
On 2015/12/15 0:30, Michal Hocko wrote: On Thu 10-12-15 14:39:14, Vladimir Davydov wrote: In the legacy hierarchy we charge memsw, which is dubious, because: - memsw.limit must be >= memory.limit, so it is impossible to limit swap usage less than memory usage. Taking into account the fact

Re: [PATCH 1/7] mm: memcontrol: charge swap to cgroup2

2015-12-14 Thread Kamezawa Hiroyuki
On 2015/12/15 4:42, Vladimir Davydov wrote: On Mon, Dec 14, 2015 at 04:30:37PM +0100, Michal Hocko wrote: On Thu 10-12-15 14:39:14, Vladimir Davydov wrote: In the legacy hierarchy we charge memsw, which is dubious, because: - memsw.limit must be >= memory.limit, so it is impossible to limit

Re: [PATCH 1/7] mm: memcontrol: charge swap to cgroup2

2015-12-14 Thread One Thousand Gnomes
> Anyway, if you don't trust a container you'd better set the hard memory > limit so that it can't hurt others no matter what it runs and how it > tweaks its sub-tree knobs. If you don't trust it put it in a VM. If it's got access to GEM graphics ioctls/nodes or some other kernel interfaces then i

Re: [PATCH 1/7] mm: memcontrol: charge swap to cgroup2

2015-12-14 Thread Vladimir Davydov
On Mon, Dec 14, 2015 at 04:30:37PM +0100, Michal Hocko wrote: > On Thu 10-12-15 14:39:14, Vladimir Davydov wrote: > > In the legacy hierarchy we charge memsw, which is dubious, because: > > > > - memsw.limit must be >= memory.limit, so it is impossible to limit > >swap usage less than memory

Re: [PATCH 1/7] mm: memcontrol: charge swap to cgroup2

2015-12-14 Thread Johannes Weiner
On Mon, Dec 14, 2015 at 04:30:37PM +0100, Michal Hocko wrote: > On Thu 10-12-15 14:39:14, Vladimir Davydov wrote: > > In the legacy hierarchy we charge memsw, which is dubious, because: > > > > - memsw.limit must be >= memory.limit, so it is impossible to limit > >swap usage less than memory

Re: [PATCH 1/7] mm: memcontrol: charge swap to cgroup2

2015-12-14 Thread Michal Hocko
On Thu 10-12-15 14:39:14, Vladimir Davydov wrote: > In the legacy hierarchy we charge memsw, which is dubious, because: > > - memsw.limit must be >= memory.limit, so it is impossible to limit >swap usage less than memory usage. Taking into account the fact that >the primary limiting mecha

Re: [PATCH 1/7] mm: memcontrol: charge swap to cgroup2

2015-12-10 Thread Vladimir Davydov
On Fri, Dec 11, 2015 at 11:48:57AM +0900, Kamezawa Hiroyuki wrote: > On 2015/12/10 20:39, Vladimir Davydov wrote: > > In the legacy hierarchy we charge memsw, which is dubious, because: > > > > - memsw.limit must be >= memory.limit, so it is impossible to limit > > swap usage less than memor

Re: [PATCH 1/7] mm: memcontrol: charge swap to cgroup2

2015-12-10 Thread Kamezawa Hiroyuki
On 2015/12/10 20:39, Vladimir Davydov wrote: > In the legacy hierarchy we charge memsw, which is dubious, because: > > - memsw.limit must be >= memory.limit, so it is impossible to limit > swap usage less than memory usage. Taking into account the fact that > the primary limiting mechani

Re: [PATCH 1/7] mm: memcontrol: charge swap to cgroup2

2015-12-10 Thread Vladimir Davydov
On Thu, Dec 10, 2015 at 11:00:27AM -0500, Johannes Weiner wrote: > On Thu, Dec 10, 2015 at 02:39:14PM +0300, Vladimir Davydov wrote: ... > > diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h > > index c6a5ed2f2744..993c9a26b637 100644 > > --- a/include/linux/memcontrol.h > > +++

Re: [PATCH 1/7] mm: memcontrol: charge swap to cgroup2

2015-12-10 Thread Johannes Weiner
On Thu, Dec 10, 2015 at 02:39:14PM +0300, Vladimir Davydov wrote: > In the legacy hierarchy we charge memsw, which is dubious, because: > > - memsw.limit must be >= memory.limit, so it is impossible to limit >swap usage less than memory usage. Taking into account the fact that >the primar

[PATCH 1/7] mm: memcontrol: charge swap to cgroup2

2015-12-10 Thread Vladimir Davydov
In the legacy hierarchy we charge memsw, which is dubious, because: - memsw.limit must be >= memory.limit, so it is impossible to limit swap usage less than memory usage. Taking into account the fact that the primary limiting mechanism in the unified hierarchy is memory.high while memory