Subject: + mm-memcontrolc-introduce-helper-mem_cgroup_zoneinfo_zone.patch added to -mm tree To: nasa4836@xxxxxxxxx,bsingharora@xxxxxxxxx,hannes@xxxxxxxxxxx,kamezawa.hiroyu@xxxxxxxxxxxxxx,mhocko@xxxxxxx From: akpm@xxxxxxxxxxxxxxxxxxxx Date: Mon, 21 Apr 2014 15:03:57 -0700 The patch titled Subject: mm/memcontrol.c: introduce helper mem_cgroup_zoneinfo_zone() has been added to the -mm tree. Its filename is mm-memcontrolc-introduce-helper-mem_cgroup_zoneinfo_zone.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-memcontrolc-introduce-helper-mem_cgroup_zoneinfo_zone.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-memcontrolc-introduce-helper-mem_cgroup_zoneinfo_zone.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Jianyu Zhan <nasa4836@xxxxxxxxx> Subject: mm/memcontrol.c: introduce helper mem_cgroup_zoneinfo_zone() Introduce helper mem_cgroup_zoneinfo_zone(). This makes mem_cgroup_iter() code more compact. Signed-off-by: Jianyu Zhan <nasa4836@xxxxxxxxx> Cc: Johannes Weiner <hannes@xxxxxxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxx> Cc: Balbir Singh <bsingharora@xxxxxxxxx> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> Cc: Jianyu Zhan <nasa4836@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/memcontrol.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff -puN mm/memcontrol.c~mm-memcontrolc-introduce-helper-mem_cgroup_zoneinfo_zone mm/memcontrol.c --- a/mm/memcontrol.c~mm-memcontrolc-introduce-helper-mem_cgroup_zoneinfo_zone +++ a/mm/memcontrol.c @@ -683,6 +683,15 @@ mem_cgroup_zoneinfo(struct mem_cgroup *m return &memcg->nodeinfo[nid]->zoneinfo[zid]; } +static struct mem_cgroup_per_zone * +mem_cgroup_zoneinfo_zone(struct mem_cgroup *memcg, struct zone *zone) +{ + int nid = zone_to_nid(zone); + int zid = zone_idx(zone); + + return mem_cgroup_zoneinfo(memcg, nid, zid); +} + struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *memcg) { return &memcg->css; @@ -1232,11 +1241,9 @@ struct mem_cgroup *mem_cgroup_iter(struc rcu_read_lock(); if (reclaim) { - int nid = zone_to_nid(reclaim->zone); - int zid = zone_idx(reclaim->zone); struct mem_cgroup_per_zone *mz; - mz = mem_cgroup_zoneinfo(root, nid, zid); + mz = mem_cgroup_zoneinfo_zone(root, reclaim->zone); iter = &mz->reclaim_iter[reclaim->priority]; if (prev && reclaim->generation != iter->generation) { iter->last_visited = NULL; @@ -1340,7 +1347,7 @@ struct lruvec *mem_cgroup_zone_lruvec(st goto out; } - mz = mem_cgroup_zoneinfo(memcg, zone_to_nid(zone), zone_idx(zone)); + mz = mem_cgroup_zoneinfo_zone(memcg, zone); lruvec = &mz->lruvec; out: /* _ Patches currently in -mm which might be from nasa4836@xxxxxxxxx are mm-memcontrolc-remove-meaningless-while-loop-in-mem_cgroup_iter.patch mm-memcontrolc-introduce-helper-mem_cgroup_zoneinfo_zone.patch linux-next.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html