Re: [PATCH] memcg: fix hotplugged memory zone oops

From: Michal Hocko
Date: Fri Nov 02 2012 - 06:54:11 EST


On Fri 02-11-12 11:21:59, Michal Hocko wrote:
> On Thu 01-11-12 18:28:02, Hugh Dickins wrote:
[...]

And I forgot to mention that the following hunk will clash with
"memcg: Simplify mem_cgroup_force_empty_list error handling" which is in
linux-next already (via Tejun's tree).
Would it be easier to split the patch into the real fix and the hunk
bellow? That one doesn't have to go into stable anyway and we would save
some merging conflicts. The updated fix on top of -mm tree is bellow for
your convinience.

> > /**
> > @@ -3688,17 +3712,17 @@ unsigned long mem_cgroup_soft_limit_recl
> > static bool mem_cgroup_force_empty_list(struct mem_cgroup *memcg,
> > int node, int zid, enum lru_list lru)
> > {
> > - struct mem_cgroup_per_zone *mz;
> > + struct lruvec *lruvec;
> > unsigned long flags, loop;
> > struct list_head *list;
> > struct page *busy;
> > struct zone *zone;
> >
> > zone = &NODE_DATA(node)->node_zones[zid];
> > - mz = mem_cgroup_zoneinfo(memcg, node, zid);
> > - list = &mz->lruvec.lists[lru];
> > + lruvec = mem_cgroup_zone_lruvec(zone, memcg);
> > + list = &lruvec->lists[lru];
> >
> > - loop = mz->lru_size[lru];
> > + loop = mem_cgroup_get_lru_size(lruvec, lru);
> > /* give some margin against EBUSY etc...*/
> > loop += 256;
> > busy = NULL;

---