Commit d983b625 authored by Shakeel Butt's avatar Shakeel Butt Committed by Greg Kroah-Hartman

mm, memcg: fix mem_cgroup_swapout() for THPs

commit d08afa14 upstream.

Commit d6810d73 ("memcg, THP, swap: make mem_cgroup_swapout()
support THP") changed mem_cgroup_swapout() to support transparent huge
page (THP).

However the patch missed one location which should be changed for
correctly handling THPs.  The resulting bug will cause the memory
cgroups whose THPs were swapped out to become zombies on deletion.

Fixes: d6810d73 ("memcg, THP, swap: make mem_cgroup_swapout() support THP")
Signed-off-by: default avatarShakeel Butt <>
Acked-by: default avatarJohannes Weiner <>
Acked-by: default avatarMichal Hocko <>
Cc: Huang Ying <>
Cc: Vladimir Davydov <>
Cc: Greg Thelen <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 13167cf4
......@@ -6044,7 +6044,7 @@ void mem_cgroup_swapout(struct page *page, swp_entry_t entry)
memcg_check_events(memcg, page);
if (!mem_cgroup_is_root(memcg))
css_put_many(&memcg->css, nr_entries);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment