memcg: fix account leak at failure of memsw acconting
authorKAMEZAWA Hiroyuki <[email protected]>
Tue, 25 Jan 2011 23:07:27 +0000 (15:07 -0800)
committerLinus Torvalds <[email protected]>
Wed, 26 Jan 2011 00:50:03 +0000 (10:50 +1000)
commit01c88e2d6b7330c0cc5867fe2297e7d826e1337d
tree0a905aa1558af7fd401d768ead121e2b11a4a2f4
parent28bd65781c848d95ba6a7f58b5c4b8265a804ec6
memcg: fix account leak at failure of memsw acconting

Commit 4b53433468 ("memcg: clean up try_charge main loop") removes a
cancel of charge at case: memory charge-> success.  mem+swap charge->
failure.

This leaks usage of memory.  Fix it.

Signed-off-by: KAMEZAWA Hiroyuki <[email protected]>
Reviewed-by: Johannes Weiner <[email protected]>
Acked-by: Daisuke Nishimura <[email protected]>
Cc: Balbir Singh <[email protected]>
Cc: <[email protected]> [2.6.36+]
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/memcontrol.c