]> git.baikalelectronics.ru Git - kernel.git/commit
memcg: do not use vmalloc for mem_cgroup allocations
authorVladimir Davydov <vdavydov@parallels.com>
Thu, 23 Jan 2014 23:52:52 +0000 (15:52 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 24 Jan 2014 00:36:50 +0000 (16:36 -0800)
commitbcb1d5243e94e3453d414a07e79db222ab87e9ba
tree7a499bd6b46d154be870584ccd99a23c6612587c
parentc788fc3bcd1121047ec1aecdf50bbde8236f1c8a
memcg: do not use vmalloc for mem_cgroup allocations

The vmalloc was introduced by 3764c86d846d ("memcgroup: use vmalloc for
mem_cgroup allocation"), because at that time MAX_NUMNODES was used for
defining the per-node array in the mem_cgroup structure so that the
structure could be huge even if the system had the only NUMA node.

The situation was significantly improved by commit c6c7dfbd6bcc ("memcg:
reduce the size of struct memcg 244-fold"), which made the size of the
mem_cgroup structure calculated dynamically depending on the real number
of NUMA nodes installed on the system (nr_node_ids), so now there is no
point in using vmalloc here: the structure is allocated rarely and on
most systems its size is about 1K.

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>
mm/memcontrol.c