Re: [BUGFIX][PATCH mmotm] memcg: fix for hierarchical reclaim

Daisuke Nishimura
2008-11-23T01:31:16Z

On Sat, 22 Nov 2008 19:33:39 +0530
Balbir Singh <balbir@linux.vnet.ibm.com> wrote:
> Daisuke Nishimura wrote:
> > mem_cgroup_from_res_counter should handle both mem->res and mem->memsw.
> > This bug leads to NULL pointer dereference BUG at mem_cgroup_calc_reclaim.
> >
> > Signed-off-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
>
> Thanks for catching this, could you please point me to the steps to reproduce
> the problem
>
You can see this BUG when you are exceeding memory.memsw.limit_in_bytes
and trying to free pages.

When exceeding memory.memsw.limit_in_bytes, fail_res points to
mem_cgroup.memsw, not to mem_cgroup.res.
So, mem_cgroup_hierarchical_reclaim() would be called with
invalid mem_cgroup.

Thanks,
Daisuke Nishimura.