[lkml]   [2017]   [Dec]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 4.14 16/95] mm, memcg: fix mem_cgroup_swapout() for THPs
4.14-stable review patch.  If anyone has any objections, please let me know.


From: Shakeel Butt <>

commit d08afa149acfd00871484ada6dabc3880524cd1c upstream.

Commit d6810d730022 ("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: d6810d730022 ("memcg, THP, swap: make mem_cgroup_swapout() support THP")
Signed-off-by: Shakeel Butt <>
Acked-by: Johannes Weiner <>
Acked-by: Michal Hocko <>
Cc: Huang Ying <>
Cc: Vladimir Davydov <>
Cc: Greg Thelen <>
Signed-off-by: Greg Kroah-Hartman <>

Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>

mm/memcontrol.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -6044,7 +6044,7 @@ void mem_cgroup_swapout(struct page *pag
memcg_check_events(memcg, page);

if (!mem_cgroup_is_root(memcg))
- css_put(&memcg->css);
+ css_put_many(&memcg->css, nr_entries);


 \ /
  Last update: 2017-12-04 17:28    [W:0.244 / U:1.284 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site