Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1658044

Re: [PATCH 5/6] mm: memcontrol: per-lruvec stats infrastructure

From Johannes Weiner <hannes@cmpxchg.org>
Newsgroups linux.kernel
Subject Re: [PATCH 5/6] mm: memcontrol: per-lruvec stats infrastructure
Date 2017-06-05 20:00 +0200
Message-ID <tP4sh-61H-15@gated-at.bofh.it> (permalink)
References <tMTUl-2jI-5@gated-at.bofh.it> <tMTUl-2jI-21@gated-at.bofh.it> <tOlvc-1CJ-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sat, Jun 03, 2017 at 08:50:02PM +0300, Vladimir Davydov wrote:
> On Tue, May 30, 2017 at 02:17:23PM -0400, Johannes Weiner wrote:
> > lruvecs are at the intersection of the NUMA node and memcg, which is
> > the scope for most paging activity.
> > 
> > Introduce a convenient accounting infrastructure that maintains
> > statistics per node, per memcg, and the lruvec itself.
> > 
> > Then convert over accounting sites for statistics that are already
> > tracked in both nodes and memcgs and can be easily switched.
> > 
> > Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
> > ---
> >  include/linux/memcontrol.h | 238 +++++++++++++++++++++++++++++++++++++++------
> >  include/linux/vmstat.h     |   1 -
> >  mm/memcontrol.c            |   6 ++
> >  mm/page-writeback.c        |  15 +--
> >  mm/rmap.c                  |   8 +-
> >  mm/workingset.c            |   9 +-
> >  6 files changed, 225 insertions(+), 52 deletions(-)
> > 
> ...
> > diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> > index 9c68a40c83e3..e37908606c0f 100644
> > --- a/mm/memcontrol.c
> > +++ b/mm/memcontrol.c
> > @@ -4122,6 +4122,12 @@ static int alloc_mem_cgroup_per_node_info(struct mem_cgroup *memcg, int node)
> >  	if (!pn)
> >  		return 1;
> >  
> > +	pn->lruvec_stat = alloc_percpu(struct lruvec_stat);
> > +	if (!pn->lruvec_stat) {
> > +		kfree(pn);
> > +		return 1;
> > +	}
> > +
> >  	lruvec_init(&pn->lruvec);
> >  	pn->usage_in_excess = 0;
> >  	pn->on_tree = false;
> 
> I don't see the matching free_percpu() anywhere, forget to patch
> free_mem_cgroup_per_node_info()?

Yes, I missed that.

---

From 4d09a522a2182acae4e36ded4211d05defd75b74 Mon Sep 17 00:00:00 2001
From: Johannes Weiner <hannes@cmpxchg.org>
Date: Mon, 5 Jun 2017 10:59:41 -0400
Subject: [PATCH] mm: memcontrol: per-lruvec stats infrastructure fix 3

As pointed out, there is a missing free_percpu() for the lruvec_stat
object in the memcg's per node info. Add this.

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
---
 mm/memcontrol.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index e37908606c0f..093fe7e06e51 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -4139,7 +4139,10 @@ static int alloc_mem_cgroup_per_node_info(struct mem_cgroup *memcg, int node)
 
 static void free_mem_cgroup_per_node_info(struct mem_cgroup *memcg, int node)
 {
-	kfree(memcg->nodeinfo[node]);
+	struct mem_cgroup_per_node *pn = memcg->nodeinfo[node];
+
+	free_percpu(pn->lruvec_stat);
+	kfree(pn);
 }
 
 static void __mem_cgroup_free(struct mem_cgroup *memcg)
-- 
2.13.0

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 5/6] mm: memcontrol: per-lruvec stats infrastructure Johannes Weiner <hannes@cmpxchg.org> - 2017-05-30 20:20 +0200
  Re: [PATCH 5/6] mm: memcontrol: per-lruvec stats infrastructure Johannes Weiner <hannes@cmpxchg.org> - 2017-05-31 19:20 +0200
    Re: [PATCH 5/6] mm: memcontrol: per-lruvec stats infrastructure Andrew Morton <akpm@linux-foundation.org> - 2017-05-31 20:20 +0200
      Re: [PATCH 5/6] mm: memcontrol: per-lruvec stats infrastructure Tony Lindgren <tony@atomide.com> - 2017-05-31 21:10 +0200
        Re: [PATCH 5/6] mm: memcontrol: per-lruvec stats infrastructure Stephen Rothwell <sfr@canb.auug.org.au> - 2017-06-01 00:10 +0200
      Re: [PATCH 5/6] mm: memcontrol: per-lruvec stats infrastructure Johannes Weiner <hannes@cmpxchg.org> - 2017-06-01 03:50 +0200
  Re: [PATCH 5/6] mm: memcontrol: per-lruvec stats infrastructure Vladimir Davydov <vdavydov.dev@gmail.com> - 2017-06-03 20:00 +0200
    Re: [PATCH 5/6] mm: memcontrol: per-lruvec stats infrastructure Johannes Weiner <hannes@cmpxchg.org> - 2017-06-05 20:00 +0200

csiph-web