This is required for splitting lru_lock into per-lruvec pieces. Signed-off-by: Konstantin Khlebnikov <khlebnikov@xxxxxxxxxx> --- mm/memcontrol.c | 20 +++++++++++++++----- 1 files changed, 15 insertions(+), 5 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 69763da..eb024c1 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -148,6 +148,7 @@ struct mem_cgroup_per_zone { struct mem_cgroup_per_node { struct mem_cgroup_per_zone zoneinfo[MAX_NR_ZONES]; + struct rcu_head rcu_head; }; struct mem_cgroup_lru_info { @@ -4657,18 +4658,27 @@ static int alloc_mem_cgroup_per_zone_info(struct mem_cgroup *memcg, int node) return 0; } +static void free_pn_rcu(struct rcu_head *rcu_head) +{ + struct mem_cgroup_per_node *pn; + int zone; + + pn = container_of(rcu_head, struct mem_cgroup_per_node, rcu_head); + + for (zone = 0; zone < MAX_NR_ZONES; zone++) + wait_lruvec_unlock(&pn->zoneinfo[zone].lruvec); + + kfree(pn); +} + static void free_mem_cgroup_per_zone_info(struct mem_cgroup *memcg, int node) { struct mem_cgroup_per_node *pn = memcg->info.nodeinfo[node]; - int zone; if (!pn) return; - for (zone = 0; zone < MAX_NR_ZONES; zone++) - wait_lruvec_unlock(&pn->zoneinfo[zone].lruvec); - - kfree(pn); + call_rcu(&pn->rcu_head, free_pn_rcu); } static struct mem_cgroup *mem_cgroup_alloc(void) -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>