Re: [LSF/MM TOPIC] VM containers

2016-01-27 Thread Vladimir Davydov
On Fri, Jan 22, 2016 at 12:11:21PM -0500, Johannes Weiner wrote: > Hi, > > On Fri, Jan 22, 2016 at 10:56:15AM -0500, Rik van Riel wrote: > > I am trying to gauge interest in discussing VM containers at the LSF/MM > > summit this year. Projects like ClearLinux, Qubes, and others are all > > trying

[PATCH] vmpressure: Fix subtree pressure detection

2016-01-27 Thread Vladimir Davydov
Fixes: 8e8ae645249b ("mm: memcontrol: hook up vmpressure to socket pressure") Signed-off-by: Vladimir Davydov <vdavy...@virtuozzo.com> --- mm/vmpressure.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/vmpressure.c b/mm/vmpressure.c index 9a6c0704211c..149fdf

[PATCH] mm: vmscan: do not clear SHRINKER_NUMA_AWARE if nr_node_ids == 1

2016-01-27 Thread Vladimir Davydov
work")), but since commit 6b4f7799c6a57 ("mm: vmscan: invoke slab shrinkers from shrink_zone()") it doesn't make any difference. Anyway, running on non-NUMA machine shouldn't make a shrinker NUMA unaware, so zap this hunk. Signed-off-by: Vladimir Davydov <vdavy...@virtuozzo.com> --- m

Re: [PATCH 1/5] mm: memcontrol: generalize locking for the page->mem_cgroup binding

2016-01-27 Thread Vladimir Davydov
On Tue, Jan 26, 2016 at 04:00:02PM -0500, Johannes Weiner wrote: > @@ -683,17 +683,17 @@ int __set_page_dirty_buffers(struct page *page) > } while (bh != head); > } > /* > - * Use mem_group_begin_page_stat() to keep PageDirty synchronized with > - * per-memcg

Re: [PATCH 2/5] mm: workingset: #define radix entry eviction mask

2016-01-27 Thread Vladimir Davydov
On Tue, Jan 26, 2016 at 04:00:03PM -0500, Johannes Weiner wrote: > This is a compile-time constant, no need to calculate it on refault. > > Signed-off-by: Johannes Weiner <han...@cmpxchg.org> Reviewed-by: Vladimir Davydov <vdavy...@virtuozzo.com>

Re: [PATCH 3/5] mm: workingset: separate shadow unpacking and refault calculation

2016-01-27 Thread Vladimir Davydov
eparation, make unpack_shadow() clearly about extracting static > data, and let workingset_refault() do all the higher-level handling. > > Signed-off-by: Johannes Weiner <han...@cmpxchg.org> Reviewed-by: Vladimir Davydov <vdavy...@virtuozzo.com>

Re: [PATCH 4/5] mm: workingset: eviction buckets for bigmem/lowbit machines

2016-01-27 Thread Vladimir Davydov
into buckets of > 2^6 pages, or 256K. > > Signed-off-by: Johannes Weiner <han...@cmpxchg.org> Reviewed-by: Vladimir Davydov <vdavy...@virtuozzo.com> One nit below. > +/* > + * Eviction timestamps need to be able to cover the full range of > + * actionable r

Re: [PATCH 5/5] mm: workingset: per-cgroup cache thrash detection

2016-01-27 Thread Vladimir Davydov
On Tue, Jan 26, 2016 at 04:00:06PM -0500, Johannes Weiner wrote: > diff --git a/include/linux/swap.h b/include/linux/swap.h > index b14a2bb33514..1cf3065c143b 100644 > --- a/include/linux/swap.h > +++ b/include/linux/swap.h > @@ -317,6 +317,7 @@ extern void

Re: [PATCH v2] mm: workingset: make workingset detection logic memcg aware

2016-01-26 Thread Vladimir Davydov
On Mon, Jan 25, 2016 at 11:39:07AM -0500, Johannes Weiner wrote: > On Sun, Jan 24, 2016 at 07:56:16PM +0300, Vladimir Davydov wrote: > > Currently, inactive_age is maintained per zone, which results in > > unexpected file page activations in case memory cgroups are used.

Re: [PATCH v2] mm: workingset: make workingset detection logic memcg aware

2016-01-26 Thread Vladimir Davydov
On Mon, Jan 25, 2016 at 11:39:07AM -0500, Johannes Weiner wrote: > On Sun, Jan 24, 2016 at 07:56:16PM +0300, Vladimir Davydov wrote: > > Currently, inactive_age is maintained per zone, which results in > > unexpected file page activations in case memory cgroups are used.

[PATCH v2] mm: workingset: make workingset detection logic memcg aware

2016-01-24 Thread Vladimir Davydov
viction counter, hence maximal refault distance will be 2GB, which should be enough for 32-bit systems. Signed-off-by: Vladimir Davydov --- Changes from v1: - Handle refaults by different cgroups properly (Johannes). v1: http://www.spinics.net/lists/linux-mm/msg92466.html include/linux/mem

[PATCH v2] mm: workingset: make workingset detection logic memcg aware

2016-01-24 Thread Vladimir Davydov
viction counter, hence maximal refault distance will be 2GB, which should be enough for 32-bit systems. Signed-off-by: Vladimir Davydov <vdavy...@virtuozzo.com> --- Changes from v1: - Handle refaults by different cgroups properly (Johannes). v1: http://www.spinics.net/lists/linux-mm/ms

Re: [PATCH v2] mm: memcontrol: fix possible memcg leak due to interrupted reclaim

2015-12-19 Thread Vladimir Davydov
On Fri, Dec 18, 2015 at 02:40:04PM -0800, Andrew Morton wrote: > On Fri, 18 Dec 2015 19:24:05 +0300 Vladimir Davydov > wrote: > > > > > OK, got it, thanks. Here goes the incremental patch (it should also fix > > the warning regarding unused cmpxchg returned value):

Re: [PATCH v2] mm: memcontrol: fix possible memcg leak due to interrupted reclaim

2015-12-19 Thread Vladimir Davydov
On Fri, Dec 18, 2015 at 02:40:04PM -0800, Andrew Morton wrote: > On Fri, 18 Dec 2015 19:24:05 +0300 Vladimir Davydov <vdavy...@virtuozzo.com> > wrote: > > > > > OK, got it, thanks. Here goes the incremental patch (it should also fix > > the warning regard

Re: [PATCH v2] mm: memcontrol: fix possible memcg leak due to interrupted reclaim

2015-12-18 Thread Vladimir Davydov
On Fri, Dec 18, 2015 at 11:00:41AM -0500, Johannes Weiner wrote: > On Fri, Dec 18, 2015 at 06:32:02PM +0300, Vladimir Davydov wrote: > > On Thu, Dec 17, 2015 at 03:02:17PM -0800, Andrew Morton wrote: > > > On Tue, 15 Dec 2015 15:31:37 +0300 Vladimir Davydov > > >

Re: [PATCH v2 7/7] Documentation: cgroup: add memory.swap.{current,max} description

2015-12-18 Thread Vladimir Davydov
On Fri, Dec 18, 2015 at 11:51:23AM +0900, Kamezawa Hiroyuki wrote: ... > Could you give here a hint how to calculate amount of swapcache, > counted both in memory.current and swap.current ? Currently it's impossible, but once memory.stat has settled in the unified hierarchy, it might be worth

Re: [PATCH v2] mm: memcontrol: fix possible memcg leak due to interrupted reclaim

2015-12-18 Thread Vladimir Davydov
On Thu, Dec 17, 2015 at 03:02:17PM -0800, Andrew Morton wrote: > On Tue, 15 Dec 2015 15:31:37 +0300 Vladimir Davydov > wrote: > > > Memory cgroup reclaim can be interrupted with mem_cgroup_iter_break() > > once enough pages have been reclaimed, in which case, in contras

Re: [PATCH v2 7/7] Documentation: cgroup: add memory.swap.{current,max} description

2015-12-18 Thread Vladimir Davydov
On Fri, Dec 18, 2015 at 11:51:23AM +0900, Kamezawa Hiroyuki wrote: ... > Could you give here a hint how to calculate amount of swapcache, > counted both in memory.current and swap.current ? Currently it's impossible, but once memory.stat has settled in the unified hierarchy, it might be worth

Re: [PATCH v2] mm: memcontrol: fix possible memcg leak due to interrupted reclaim

2015-12-18 Thread Vladimir Davydov
On Fri, Dec 18, 2015 at 11:00:41AM -0500, Johannes Weiner wrote: > On Fri, Dec 18, 2015 at 06:32:02PM +0300, Vladimir Davydov wrote: > > On Thu, Dec 17, 2015 at 03:02:17PM -0800, Andrew Morton wrote: > > > On Tue, 15 Dec 2015 15:31:37 +0300 Vladimir Davydov > > > <

Re: [PATCH v2] mm: memcontrol: fix possible memcg leak due to interrupted reclaim

2015-12-18 Thread Vladimir Davydov
On Thu, Dec 17, 2015 at 03:02:17PM -0800, Andrew Morton wrote: > On Tue, 15 Dec 2015 15:31:37 +0300 Vladimir Davydov <vdavy...@virtuozzo.com> > wrote: > > > Memory cgroup reclaim can be interrupted with mem_cgroup_iter_break() > > once enough pages have been reclaimed,

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

2015-12-17 Thread Vladimir Davydov
ap on commit (see mem_cgroup_commit_charge). Signed-off-by: Vladimir Davydov --- Changes in v2: - Rename mem_cgroup_charge_swap -> mem_cgroup_try_charge_swap to conform to other memcg charging methods. - Remove unnecessary READ_ONCE from mem_cgroup_get_limit. - Uncharge swap only when the

[PATCH v2 5/7] mm: vmscan: do not scan anon pages if memcg swap limit is hit

2015-12-17 Thread Vladimir Davydov
We don't scan anonymous memory if we ran out of swap, neither should we do it in case memcg swap limit is hit, because swap out is impossible anyway. Signed-off-by: Vladimir Davydov Acked-by: Johannes Weiner --- Changes in v2: - Do not check swap limit on the legacy hierarchy. include/linux

[PATCH v2 6/7] mm: free swap cache aggressively if memcg swap is full

2015-12-17 Thread Vladimir Davydov
own swap limit. Signed-off-by: Vladimir Davydov Acked-by: Johannes Weiner --- Changes in v2: - Remove unnecessary PageSwapCache check from mem_cgroup_swap_full. - Do not check swap limit on the legacy hierarchy. include/linux/swap.h | 6 ++ mm/memcontrol.c |

[PATCH v2 4/7] swap.h: move memcg related stuff to the end of the file

2015-12-17 Thread Vladimir Davydov
The following patches will add more functions to the memcg section of include/linux/swap.h. Some of them will need values defined below the current location of the section. So let's move the section to the end of the file. No functional changes intended. Signed-off-by: Vladimir Davydov Acked

[PATCH v2 7/7] Documentation: cgroup: add memory.swap.{current,max} description

2015-12-17 Thread Vladimir Davydov
The rationale of separate swap counter is given by Johannes Weiner. Signed-off-by: Vladimir Davydov --- Changes in v2: - Add rationale of separate swap counter provided by Johannes. Documentation/cgroup.txt | 33 + 1 file changed, 33 insertions(+) diff --git

[PATCH v2 3/7] mm: memcontrol: replace mem_cgroup_lruvec_online with mem_cgroup_online

2015-12-17 Thread Vladimir Davydov
-by: Vladimir Davydov Acked-by: Johannes Weiner --- include/linux/memcontrol.h | 27 ++- mm/vmscan.c| 2 +- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 6e0126230878

[PATCH v2 2/7] mm: vmscan: pass memcg to get_scan_count()

2015-12-17 Thread Vladimir Davydov
memcg will come in handy in get_scan_count(). It can already be used for getting swappiness immediately in get_scan_count() instead of passing it around. The following patches will add more memcg-related values, which will be used there. Signed-off-by: Vladimir Davydov Acked-by: Johannes Weiner

[PATCH v2 0/7] Add swap accounting to cgroup2

2015-12-17 Thread Vladimir Davydov
. Thanks, Vladimir Davydov (7): mm: memcontrol: charge swap to cgroup2 mm: vmscan: pass memcg to get_scan_count() mm: memcontrol: replace mem_cgroup_lruvec_online with mem_cgroup_online swap.h: move memcg related stuff to the end of the file mm: vmscan: do not scan anon pages if memcg swap

Re: [PATCH] mm: memcontrol: clean up alloc, online, offline, free functions fix

2015-12-17 Thread Vladimir Davydov
>offlining itself. > > 3. Children in !use_hierarchy mode would inherit the OOM killer >setting from their physical parent rather than the logical parent, >rootmemcg. This is silly, but no reason to change the semantics as >part of this cleanup patch, so restore

Re: [PATCH] mm: memcontrol: clean up alloc, online, offline, free functions fix

2015-12-17 Thread Vladimir Davydov
>offlining itself. > > 3. Children in !use_hierarchy mode would inherit the OOM killer >setting from their physical parent rather than the logical parent, >rootmemcg. This is silly, but no reason to change the semantics as >part of this cleanup patch, so restore i

[PATCH v2 0/7] Add swap accounting to cgroup2

2015-12-17 Thread Vladimir Davydov
. Thanks, Vladimir Davydov (7): mm: memcontrol: charge swap to cgroup2 mm: vmscan: pass memcg to get_scan_count() mm: memcontrol: replace mem_cgroup_lruvec_online with mem_cgroup_online swap.h: move memcg related stuff to the end of the file mm: vmscan: do not scan anon pages if memcg swap

[PATCH v2 3/7] mm: memcontrol: replace mem_cgroup_lruvec_online with mem_cgroup_online

2015-12-17 Thread Vladimir Davydov
-by: Vladimir Davydov <vdavy...@virtuozzo.com> Acked-by: Johannes Weiner <han...@cmpxchg.org> --- include/linux/memcontrol.h | 27 ++- mm/vmscan.c| 2 +- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/include/linux/memcontrol

[PATCH v2 2/7] mm: vmscan: pass memcg to get_scan_count()

2015-12-17 Thread Vladimir Davydov
memcg will come in handy in get_scan_count(). It can already be used for getting swappiness immediately in get_scan_count() instead of passing it around. The following patches will add more memcg-related values, which will be used there. Signed-off-by: Vladimir Davydov <vdavy...@virtuozzo.

[PATCH v2 4/7] swap.h: move memcg related stuff to the end of the file

2015-12-17 Thread Vladimir Davydov
The following patches will add more functions to the memcg section of include/linux/swap.h. Some of them will need values defined below the current location of the section. So let's move the section to the end of the file. No functional changes intended. Signed-off-by: Vladimir Davydov <vd

[PATCH v2 5/7] mm: vmscan: do not scan anon pages if memcg swap limit is hit

2015-12-17 Thread Vladimir Davydov
We don't scan anonymous memory if we ran out of swap, neither should we do it in case memcg swap limit is hit, because swap out is impossible anyway. Signed-off-by: Vladimir Davydov <vdavy...@virtuozzo.com> Acked-by: Johannes Weiner <han...@cmpxchg.org> --- Changes in v2: - Do no

[PATCH v2 7/7] Documentation: cgroup: add memory.swap.{current,max} description

2015-12-17 Thread Vladimir Davydov
The rationale of separate swap counter is given by Johannes Weiner. Signed-off-by: Vladimir Davydov <vdavy...@virtuozzo.com> --- Changes in v2: - Add rationale of separate swap counter provided by Johannes. Documentation/cgroup.txt | 33 + 1 file chang

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

2015-12-17 Thread Vladimir Davydov
ap on commit (see mem_cgroup_commit_charge). Signed-off-by: Vladimir Davydov <vdavy...@virtuozzo.com> --- Changes in v2: - Rename mem_cgroup_charge_swap -> mem_cgroup_try_charge_swap to conform to other memcg charging methods. - Remove unnecessary READ_ONCE from mem_cgroup_get_limit.

[PATCH v2 6/7] mm: free swap cache aggressively if memcg swap is full

2015-12-17 Thread Vladimir Davydov
own swap limit. Signed-off-by: Vladimir Davydov <vdavy...@virtuozzo.com> Acked-by: Johannes Weiner <han...@cmpxchg.org> --- Changes in v2: - Remove unnecessary PageSwapCache check from mem_cgroup_swap_full. - Do not check swap limit on the legacy hierarchy. include/linux/swap.h

Re: [PATCH 4/4] mm: memcontrol: clean up alloc, online, offline, free functions

2015-12-16 Thread Vladimir Davydov
On Tue, Dec 15, 2015 at 02:38:58PM -0500, Johannes Weiner wrote: > On Mon, Dec 14, 2015 at 08:14:55PM +0300, Vladimir Davydov wrote: > > On Fri, Dec 11, 2015 at 02:54:13PM -0500, Johannes Weiner wrote: > > ... > > > -static int > > > -mem_cgroup_css_onlin

Re: [PATCH 4/4] mm: memcontrol: clean up alloc, online, offline, free functions

2015-12-16 Thread Vladimir Davydov
On Tue, Dec 15, 2015 at 02:38:58PM -0500, Johannes Weiner wrote: > On Mon, Dec 14, 2015 at 08:14:55PM +0300, Vladimir Davydov wrote: > > On Fri, Dec 11, 2015 at 02:54:13PM -0500, Johannes Weiner wrote: > > ... > > > -static int > > > -mem_cgroup_css_onlin

[PATCH v2] mm: memcontrol: fix possible memcg leak due to interrupted reclaim

2015-12-15 Thread Vladimir Davydov
c8fb31ad2e ("mm: memcontrol: convert reclaim iterator to simple css refcounting") Signed-off-by: Vladimir Davydov Acked-by: Michal Hocko Cc: Johannes Weiner Cc: # 3.19+ --- Changes in v2: As pointed out by Johannes, clearing iter->position when interrupting memcg reclaim, as it

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

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: > >> > >> - mem

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: > >> > >> - mem

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

[PATCH v2] mm: memcontrol: fix possible memcg leak due to interrupted reclaim

2015-12-15 Thread Vladimir Davydov
c8fb31ad2e ("mm: memcontrol: convert reclaim iterator to simple css refcounting") Signed-off-by: Vladimir Davydov <vdavy...@virtuozzo.com> Acked-by: Michal Hocko <mho...@kernel.org> Cc: Johannes Weiner <han...@cmpxchg.org> Cc: <sta...@vger.kernel.org> # 3.19+ --- Cha

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 > >

Re: [PATCH] mm: memcontrol: fix possible memcg leak due to interrupted reclaim

2015-12-14 Thread Vladimir Davydov
On Mon, Dec 14, 2015 at 10:19:01AM -0500, Johannes Weiner wrote: ... > > @@ -859,14 +859,12 @@ struct mem_cgroup *mem_cgroup_iter(struct mem_cgroup > > *root, > > if (prev && reclaim->generation != iter->generation) > > goto out_unlock; > > > > - do { >

Re: [PATCH 4/4] mm: memcontrol: clean up alloc, online, offline, free functions

2015-12-14 Thread Vladimir Davydov
On Fri, Dec 11, 2015 at 02:54:13PM -0500, Johannes Weiner wrote: ... > -static int > -mem_cgroup_css_online(struct cgroup_subsys_state *css) > +static struct cgroup_subsys_state * __ref > +mem_cgroup_css_alloc(struct cgroup_subsys_state *parent_css) > { > - struct mem_cgroup *memcg =

Re: [PATCH 4/4] mm: memcontrol: clean up alloc, online, offline, free functions

2015-12-14 Thread Vladimir Davydov
On Fri, Dec 11, 2015 at 02:54:13PM -0500, Johannes Weiner wrote: ... > -static int > -mem_cgroup_css_online(struct cgroup_subsys_state *css) > +static struct cgroup_subsys_state * __ref > +mem_cgroup_css_alloc(struct cgroup_subsys_state *parent_css) > { > - struct mem_cgroup *memcg =

Re: [PATCH] mm: memcontrol: fix possible memcg leak due to interrupted reclaim

2015-12-14 Thread Vladimir Davydov
On Mon, Dec 14, 2015 at 10:19:01AM -0500, Johannes Weiner wrote: ... > > @@ -859,14 +859,12 @@ struct mem_cgroup *mem_cgroup_iter(struct mem_cgroup > > *root, > > if (prev && reclaim->generation != iter->generation) > > goto out_unlock; > > > > - do { >

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 > >

Re: [PATCH] mm: memcontrol: fix possible memcg leak due to interrupted reclaim

2015-12-12 Thread Vladimir Davydov
On Sat, Dec 12, 2015 at 11:45:40AM -0500, Johannes Weiner wrote: > On Sat, Dec 12, 2015 at 04:34:02PM +0300, Vladimir Davydov wrote: > > Memory cgroup reclaim can be interrupted with mem_cgroup_iter_break() > > once enough pages have been reclaimed, in which case, in contrast to a

Re: [PATCH 3/4] mm: memcontrol: flatten struct cg_proto

2015-12-12 Thread Vladimir Davydov
t clearer which code is legacy. > > Suggested-by: Vladimir Davydov > Signed-off-by: Johannes Weiner Looks good to me, thanks! Acked-by: Vladimir Davydov -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kerne

Re: [PATCH 2/4] mm: memcontrol: reign in the CONFIG space madness

2015-12-12 Thread Vladimir Davydov
Johannes Weiner Acked-by: Vladimir Davydov > @@ -4374,17 +4342,11 @@ static void mem_cgroup_css_free(struct > cgroup_subsys_state *css) > { > struct mem_cgroup *memcg = mem_cgroup_from_css(css); > > -#ifdef CONFIG_INET > if (cgroup_subsys_on_dfl(memory_cgr

Re: [PATCH 7/7] Documentation: cgroup: add memory.swap.{current,max} description

2015-12-12 Thread Vladimir Davydov
On Fri, Dec 11, 2015 at 02:42:54PM -0500, Johannes Weiner wrote: > On Thu, Dec 10, 2015 at 02:39:20PM +0300, Vladimir Davydov wrote: > > Signed-off-by: Vladimir Davydov > > Acked-by: Johannes Weiner > > Can we include a blurb for R-5-1 of cgroups.txt as well to explain wh

Re: [PATCH 6/7] mm: free swap cache aggressively if memcg swap is full

2015-12-12 Thread Vladimir Davydov
On Fri, Dec 11, 2015 at 02:33:58PM -0500, Johannes Weiner wrote: > On Thu, Dec 10, 2015 at 02:39:19PM +0300, Vladimir Davydov wrote: > > Swap cache pages are freed aggressively if swap is nearly full (>50% > > currently), because otherwise we are likely to stop scanning anonymou

[PATCH] mm: memcontrol: fix possible memcg leak due to interrupted reclaim

2015-12-12 Thread Vladimir Davydov
reclaim iterator to simple css refcounting") Signed-off-by: Vladimir Davydov Cc: Johannes Weiner Cc: Michal Hocko Cc: # 3.19+ --- include/linux/memcontrol.h | 8 +--- mm/memcontrol.c| 28 +++- mm/vmscan.c| 2 +- 3 files changed, 29 inse

[PATCH] mm: memcontrol: fix possible memcg leak due to interrupted reclaim

2015-12-12 Thread Vladimir Davydov
reclaim iterator to simple css refcounting") Signed-off-by: Vladimir Davydov <vdavy...@virtuozzo.com> Cc: Johannes Weiner <han...@cmpxchg.org> Cc: Michal Hocko <mho...@kernel.org> Cc: <sta...@vger.kernel.org> # 3.19+ --- include/linux/memcontrol.h

Re: [PATCH 7/7] Documentation: cgroup: add memory.swap.{current,max} description

2015-12-12 Thread Vladimir Davydov
On Fri, Dec 11, 2015 at 02:42:54PM -0500, Johannes Weiner wrote: > On Thu, Dec 10, 2015 at 02:39:20PM +0300, Vladimir Davydov wrote: > > Signed-off-by: Vladimir Davydov <vdavy...@virtuozzo.com> > > Acked-by: Johannes Weiner <han...@cmpxchg.org> > > Can we include

Re: [PATCH 6/7] mm: free swap cache aggressively if memcg swap is full

2015-12-12 Thread Vladimir Davydov
On Fri, Dec 11, 2015 at 02:33:58PM -0500, Johannes Weiner wrote: > On Thu, Dec 10, 2015 at 02:39:19PM +0300, Vladimir Davydov wrote: > > Swap cache pages are freed aggressively if swap is nearly full (>50% > > currently), because otherwise we are likely to stop scanning anonymou

Re: [PATCH 2/4] mm: memcontrol: reign in the CONFIG space madness

2015-12-12 Thread Vladimir Davydov
Johannes Weiner <han...@cmpxchg.org> Acked-by: Vladimir Davydov <vdavy...@virtuozzo.com> > @@ -4374,17 +4342,11 @@ static void mem_cgroup_css_free(struct > cgroup_subsys_state *css) > { > struct mem_cgroup *memcg = mem_cgroup_from_css(css); > > -#ifdef

Re: [PATCH 3/4] mm: memcontrol: flatten struct cg_proto

2015-12-12 Thread Vladimir Davydov
t clearer which code is legacy. > > Suggested-by: Vladimir Davydov <vdavy...@virtuozzo.com> > Signed-off-by: Johannes Weiner <han...@cmpxchg.org> Looks good to me, thanks! Acked-by: Vladimir Davydov <vdavy...@virtuozzo.com> -- To unsubscribe from this list: send the l

Re: [PATCH] mm: memcontrol: fix possible memcg leak due to interrupted reclaim

2015-12-12 Thread Vladimir Davydov
On Sat, Dec 12, 2015 at 11:45:40AM -0500, Johannes Weiner wrote: > On Sat, Dec 12, 2015 at 04:34:02PM +0300, Vladimir Davydov wrote: > > Memory cgroup reclaim can be interrupted with mem_cgroup_iter_break() > > once enough pages have been reclaimed, in which case, in contrast to a

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 >

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/inclu

[PATCH 2/7] mm: vmscan: pass memcg to get_scan_count()

2015-12-10 Thread Vladimir Davydov
memcg will come in handy in get_scan_count(). It can already be used for getting swappiness immediately in get_scan_count() instead of passing it around. The following patches will add more memcg-related values, which will be used there. Signed-off-by: Vladimir Davydov --- mm/vmscan.c | 20

[PATCH 5/7] mm: vmscan: do not scan anon pages if memcg swap limit is hit

2015-12-10 Thread Vladimir Davydov
We don't scan anonymous memory if we ran out of swap, neither should we do it in case memcg swap limit is hit, because swap out is impossible anyway. Signed-off-by: Vladimir Davydov --- include/linux/swap.h | 6 ++ mm/memcontrol.c | 13 + mm/vmscan.c | 2 +- 3

[PATCH 3/7] mm: memcontrol: replace mem_cgroup_lruvec_online with mem_cgroup_online

2015-12-10 Thread Vladimir Davydov
-by: Vladimir Davydov --- include/linux/memcontrol.h | 27 ++- mm/vmscan.c| 2 +- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 993c9a26b637..c9a14e1eab62 100644 --- a/include

[PATCH 7/7] Documentation: cgroup: add memory.swap.{current,max} description

2015-12-10 Thread Vladimir Davydov
Signed-off-by: Vladimir Davydov --- Documentation/cgroup.txt | 16 1 file changed, 16 insertions(+) diff --git a/Documentation/cgroup.txt b/Documentation/cgroup.txt index 31d1f7bf12a1..21c6c013c339 100644 --- a/Documentation/cgroup.txt +++ b/Documentation/cgroup.txt @@ -819,6

[PATCH 4/7] swap.h: move memcg related stuff to the end of the file

2015-12-10 Thread Vladimir Davydov
The following patches will add more functions to the memcg section of include/linux/swap.h. Some of them will need values defined below the current location of the section. So let's move the section to the end of the file. No functional changes intended. Signed-off-by: Vladimir Davydov

[PATCH 6/7] mm: free swap cache aggressively if memcg swap is full

2015-12-10 Thread Vladimir Davydov
own swap limit. Signed-off-by: Vladimir Davydov --- include/linux/swap.h | 6 ++ mm/memcontrol.c | 23 +++ mm/memory.c | 3 ++- mm/swapfile.c| 2 +- mm/vmscan.c | 2 +- 5 files changed, 33 insertions(+), 3 deletions(-) diff --git a/incl

[PATCH 0/7] Add swap accounting to cgroup2

2015-12-10 Thread Vladimir Davydov
counter. Patches 2-6 make memcg reclaim follow the heuristics used on global reclaim for handling anon/swap. Patch 7 updates documentation. Thanks, Vladimir Davydov (7): mm: memcontrol: charge swap to cgroup2 mm: vmscan: pass memcg to get_scan_count() mm: memcontrol: replace

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

2015-12-10 Thread Vladimir Davydov
ap.max. Signed-off-by: Vladimir Davydov --- include/linux/memcontrol.h | 1 + include/linux/swap.h | 5 ++ mm/memcontrol.c| 123 + mm/shmem.c | 4 ++ mm/swap_state.c| 5 ++ 5 files changed, 129 inse

Re: [RFC PATCH] mm: memcontrol: reign in CONFIG space madness

2015-12-10 Thread Vladimir Davydov
On Wed, Dec 09, 2015 at 03:30:04PM -0500, Johannes Weiner wrote: > there has been quite a bit of trouble that stems from dividing our > CONFIG space and having to provide real code and dummy functions > correctly in all possible combinations. This is amplified by having > the legacy mode and the

Re: [PATCH] mm: memcontrol: MEMCG no longer works with SLOB

2015-12-10 Thread Vladimir Davydov
On Wed, Dec 09, 2015 at 03:01:07PM -0500, Johannes Weiner wrote: > On Wed, Dec 09, 2015 at 05:32:39PM +0100, Arnd Bergmann wrote: > > The change to move the kmem accounting into the normal memcg > > code means we can no longer use memcg with slob, which lacks > > the memcg_params member in its

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/inclu

Re: [PATCH] mm: memcontrol: MEMCG no longer works with SLOB

2015-12-10 Thread Vladimir Davydov
On Wed, Dec 09, 2015 at 03:01:07PM -0500, Johannes Weiner wrote: > On Wed, Dec 09, 2015 at 05:32:39PM +0100, Arnd Bergmann wrote: > > The change to move the kmem accounting into the normal memcg > > code means we can no longer use memcg with slob, which lacks > > the memcg_params member in its

[PATCH 2/7] mm: vmscan: pass memcg to get_scan_count()

2015-12-10 Thread Vladimir Davydov
memcg will come in handy in get_scan_count(). It can already be used for getting swappiness immediately in get_scan_count() instead of passing it around. The following patches will add more memcg-related values, which will be used there. Signed-off-by: Vladimir Davydov <vdavy...@virtuozzo.

[PATCH 0/7] Add swap accounting to cgroup2

2015-12-10 Thread Vladimir Davydov
counter. Patches 2-6 make memcg reclaim follow the heuristics used on global reclaim for handling anon/swap. Patch 7 updates documentation. Thanks, Vladimir Davydov (7): mm: memcontrol: charge swap to cgroup2 mm: vmscan: pass memcg to get_scan_count() mm: memcontrol: replace

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

2015-12-10 Thread Vladimir Davydov
ap.max. Signed-off-by: Vladimir Davydov <vdavy...@virtuozzo.com> --- include/linux/memcontrol.h | 1 + include/linux/swap.h | 5 ++ mm/memcontrol.c| 123 + mm/shmem.c | 4 ++ mm/swap_state.c| 5

[PATCH 5/7] mm: vmscan: do not scan anon pages if memcg swap limit is hit

2015-12-10 Thread Vladimir Davydov
We don't scan anonymous memory if we ran out of swap, neither should we do it in case memcg swap limit is hit, because swap out is impossible anyway. Signed-off-by: Vladimir Davydov <vdavy...@virtuozzo.com> --- include/linux/swap.h | 6 ++ mm/memcontrol.c | 13 +++

[PATCH 7/7] Documentation: cgroup: add memory.swap.{current,max} description

2015-12-10 Thread Vladimir Davydov
Signed-off-by: Vladimir Davydov <vdavy...@virtuozzo.com> --- Documentation/cgroup.txt | 16 1 file changed, 16 insertions(+) diff --git a/Documentation/cgroup.txt b/Documentation/cgroup.txt index 31d1f7bf12a1..21c6c013c339 100644 --- a/Documentation/cgroup.txt

[PATCH 3/7] mm: memcontrol: replace mem_cgroup_lruvec_online with mem_cgroup_online

2015-12-10 Thread Vladimir Davydov
-by: Vladimir Davydov <vdavy...@virtuozzo.com> --- include/linux/memcontrol.h | 27 ++- mm/vmscan.c| 2 +- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 993c9a26b637..c9a14e

[PATCH 4/7] swap.h: move memcg related stuff to the end of the file

2015-12-10 Thread Vladimir Davydov
The following patches will add more functions to the memcg section of include/linux/swap.h. Some of them will need values defined below the current location of the section. So let's move the section to the end of the file. No functional changes intended. Signed-off-by: Vladimir Davydov <vd

[PATCH 6/7] mm: free swap cache aggressively if memcg swap is full

2015-12-10 Thread Vladimir Davydov
own swap limit. Signed-off-by: Vladimir Davydov <vdavy...@virtuozzo.com> --- include/linux/swap.h | 6 ++ mm/memcontrol.c | 23 +++ mm/memory.c | 3 ++- mm/swapfile.c| 2 +- mm/vmscan.c | 2 +- 5 files changed, 33 insertions(+), 3

Re: [RFC PATCH] mm: memcontrol: reign in CONFIG space madness

2015-12-10 Thread Vladimir Davydov
On Wed, Dec 09, 2015 at 03:30:04PM -0500, Johannes Weiner wrote: > there has been quite a bit of trouble that stems from dividing our > CONFIG space and having to provide real code and dummy functions > correctly in all possible combinations. This is amplified by having > the legacy mode and the

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 >

[PATCH -mm] net: drop tcp_memcontrol.c

2015-12-09 Thread Vladimir Davydov
tcp_memcontrol.c only contains legacy memory.tcp.kmem.* file definitions and mem_cgroup->tcp_mem init/destroy stuff. This doesn't belong to network subsys. Let's move it to memcontrol.c. This also allows us to reuse generic code for handling legacy memcg files. Signed-off-by: Vladimir Davy

Re: [PATCH 8/8] mm: memcontrol: introduce CONFIG_MEMCG_LEGACY_KMEM

2015-12-09 Thread Vladimir Davydov
On Tue, Dec 08, 2015 at 01:34:25PM -0500, Johannes Weiner wrote: > Let the user know that CONFIG_MEMCG_KMEM does not apply to the cgroup2 > interface. This also makes legacy-only code sections stand out better. > > Signed-off-by: Johannes Weiner Acked-by: Vladimir Davydov -- To

Re: [PATCH 7/8] mm: memcontrol: account "kmem" consumers in cgroup2 memory controller

2015-12-09 Thread Vladimir Davydov
t; - signal_struct > - sighand_struct > - fs_struct > - files_struct > - fdtable and fdtable->full_fds_bits > - dentry and external_name > - inode for all filesystems. > > This should give us reasonable memory isolation for most common > wor

Re: [PATCH 6/8] mm: memcontrol: move kmem accounting code to CONFIG_MEMCG

2015-12-09 Thread Vladimir Davydov
On Tue, Dec 08, 2015 at 01:34:23PM -0500, Johannes Weiner wrote: > The cgroup2 memory controller will account important in-kernel memory > consumers per default. Move all necessary components to CONFIG_MEMCG. > > Signed-off-by: Johannes Weiner Acked-by: Vladimir Davydov -- To unsu

Re: [PATCH 5/8] mm: memcontrol: separate kmem code from legacy tcp accounting code

2015-12-09 Thread Vladimir Davydov
state init from the tcp control interface init in > preparation for that. > > Signed-off-by: Johannes Weiner Acked-by: Vladimir Davydov -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordo

Re: [PATCH 4/8] mm: memcontrol: group kmem init and exit functions together

2015-12-09 Thread Vladimir Davydov
On Tue, Dec 08, 2015 at 01:34:21PM -0500, Johannes Weiner wrote: > Put all the related code to setup and teardown the kmem accounting > state into the same location. No functional change intended. > > Signed-off-by: Johannes Weiner Acked-by: Vladimir Davydov -- To unsubscribe fr

Re: [PATCH 3/8] mm: memcontrol: give the kmem states more descriptive names

2015-12-09 Thread Vladimir Davydov
ff-by: Johannes Weiner Acked-by: Vladimir Davydov -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH 2/8] mm: memcontrol: remove double kmem page_counter init

2015-12-09 Thread Vladimir Davydov
On Tue, Dec 08, 2015 at 01:34:19PM -0500, Johannes Weiner wrote: > The kmem page_counter's limit is initialized to PAGE_COUNTER_MAX > inside mem_cgroup_css_online(). There is no need to repeat this > from memcg_propagate_kmem(). > > Signed-off-by: Johannes Weiner Acked-by: V

Re: [PATCH 1/8] mm: memcontrol: drop unused @css argument in memcg_init_kmem

2015-12-09 Thread Vladimir Davydov
On Tue, Dec 08, 2015 at 01:34:18PM -0500, Johannes Weiner wrote: > Signed-off-by: Johannes Weiner Acked-by: Vladimir Davydov -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo

Re: [PATCH 1/8] mm: memcontrol: drop unused @css argument in memcg_init_kmem

2015-12-09 Thread Vladimir Davydov
On Tue, Dec 08, 2015 at 01:34:18PM -0500, Johannes Weiner wrote: > Signed-off-by: Johannes Weiner <han...@cmpxchg.org> Acked-by: Vladimir Davydov <vdavy...@virtuozzo.com> -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the bo

Re: [PATCH 2/8] mm: memcontrol: remove double kmem page_counter init

2015-12-09 Thread Vladimir Davydov
mpxchg.org> Acked-by: Vladimir Davydov <vdavy...@virtuozzo.com> -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH 3/8] mm: memcontrol: give the kmem states more descriptive names

2015-12-09 Thread Vladimir Davydov
d-off-by: Johannes Weiner <han...@cmpxchg.org> Acked-by: Vladimir Davydov <vdavy...@virtuozzo.com> -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-

<    2   3   4   5   6   7   8   9   10   11   >