]> git.baikalelectronics.ru Git - kernel.git/commit
page_cgroup: fix horrid swap accounting regression
authorHugh Dickins <hughd@google.com>
Tue, 6 Mar 2012 04:52:55 +0000 (20:52 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 6 Mar 2012 16:18:23 +0000 (08:18 -0800)
commit27953f067e53a12522e5909afe3b666a59bc8202
tree6ddc11131cd557d0d3a32ddeb829bfefe542101b
parente085e50e1cbc7cf4a3650a9de7f9c2d64e36c805
page_cgroup: fix horrid swap accounting regression

Why is memcg's swap accounting so broken? Insane counts, wrong
ownership, unfreeable structures, which later get freed and then
accessed after free.

Turns out to be a tiny a little 3.3-rc1 regression in 833e8083f30a
"page_cgroup: add helper function to get swap_cgroup": the helper
function (actually named lookup_swap_cgroup()) returns an address using
void* arithmetic, but the structure in question is a short.

Signed-off-by: Hugh Dickins <hughd@google.com>
Reviewed-by: Bob Liu <lliubbo@gmail.com>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Johannes Weiner <jweiner@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/page_cgroup.c