[PATCH] mm: memcontrol: per-lruvec stats infrastructure fix 3

From: Johannes Weiner
Date: Mon Jun 05 2017 - 10:59:41 EST


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