]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mm: memcontrol: catch root bypass in move precharge
authorJohannes Weiner <hannes@cmpxchg.org>
Thu, 26 Jun 2014 00:42:37 +0000 (10:42 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 26 Jun 2014 00:42:37 +0000 (10:42 +1000)
commite3929abdc6274a1ddce67b82cf252112bf9ad9fc
tree2ebc494805fb76fdf77d2925b16691cfada9ef56
parentcf116e596d90b44779c98acd92b955c7e3f219e2
mm: memcontrol: catch root bypass in move precharge

When mem_cgroup_try_charge() returns -EINTR, it bypassed the charge to the
root memcg.  But move precharging does not catch this and treats this case
as if no charge had happened, thus leaking a charge against root.  Because
of an old optimization, the root memcg's res_counter is not actually
charged right now, but it's still an imbalance and subsequent patches will
charge the root memcg again.

Catch those bypasses to the root memcg and properly cancel them before
giving up the move.

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Michal Hocko <mhocko@suse.cz>
Cc: Hugh Dickins <hughd@google.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Vladimir Davydov <vdavydov@parallels.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/memcontrol.c