]> git.baikalelectronics.ru Git - kernel.git/commit
mm: memcontrol: clean up memcg zoneinfo lookup
authorJianyu Zhan <nasa4836@gmail.com>
Fri, 6 Jun 2014 21:38:20 +0000 (14:38 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 6 Jun 2014 23:08:17 +0000 (16:08 -0700)
commit40a992d6fa8e426d71176b51e5093b8b466653e7
tree3c4a182e837ce328b4f994f9021d7265a8c1b240
parentb4e22f32e02d20c4a55ad2f0b82cafc663fc79b2
mm: memcontrol: clean up memcg zoneinfo lookup

Memcg zoneinfo lookup sites have either the page, the zone, or the node
id and zone index, but sites that only have the zone have to look up the
node id and zone index themselves, whereas sites that already have those
two integers use a function for a simple pointer chase.

Provide mem_cgroup_zone_zoneinfo() that takes a zone pointer and let
sites that already have node id and zone index - all for each node, for
each zone iterators - use &memcg->nodeinfo[nid]->zoneinfo[zid].

Rename page_cgroup_zoneinfo() to mem_cgroup_page_zoneinfo() to match.

Signed-off-by: Jianyu Zhan <nasa4836@gmail.com>
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/memcontrol.c