]> git.baikalelectronics.ru Git - kernel.git/commit
mm: memcg: use proper memcg in limit bypass
authorJohannes Weiner <hannes@cmpxchg.org>
Thu, 31 Oct 2013 23:34:13 +0000 (16:34 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 31 Oct 2013 23:58:13 +0000 (16:58 -0700)
commit5e0d0f317b278a5d65b9863dfedfb44e2846ca9e
treeb8e0a03d787c2219b1d1fd833193de7abc59442e
parent7342222e5af4c03e0c67b67774e328946e4c7b5d
mm: memcg: use proper memcg in limit bypass

Commit e7f36847954b ("fs: buffer: move allocation failure loop into the
allocator") allowed __GFP_NOFAIL allocations to bypass the limit if they
fail to reclaim enough memory for the charge.  But because the main test
case was on a 3.2-based system, the patch missed the fact that on newer
kernels the charge function needs to return root_mem_cgroup when
bypassing the limit, and not NULL.  This will corrupt whatever memory is
at NULL + percpu pointer offset.  Fix this quickly before problems are
reported.

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