Skip to content

Commit 695c608

Browse files
Vladimir Davydovtorvalds
authored andcommitted
memcg: fix memcg_size() calculation
The mem_cgroup structure contains nr_node_ids pointers to mem_cgroup_per_node objects, not the objects themselves. Signed-off-by: Vladimir Davydov <vdavydov@parallels.com> Acked-by: Michal Hocko <mhocko@suse.cz> Cc: Glauber Costa <glommer@openvz.org> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Balbir Singh <bsingharora@gmail.com> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 4eb9198 commit 695c608

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/memcontrol.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ struct mem_cgroup {
338338
static size_t memcg_size(void)
339339
{
340340
return sizeof(struct mem_cgroup) +
341-
nr_node_ids * sizeof(struct mem_cgroup_per_node);
341+
nr_node_ids * sizeof(struct mem_cgroup_per_node *);
342342
}
343343

344344
/* internal only representation about the status of kmem accounting. */

0 commit comments

Comments
 (0)