[PATCH] mm: memcontrol: fix possible memcg leak due to interrupted reclaim fix

From: Johannes Weiner
Date: Wed Dec 23 2015 - 17:16:07 EST


When we handled multiple css references in mem_cgroup_iter() it got a
little confusing which puts belong to which gets. Now that we only ref
the position css it's obvious, and a multi-line comment to explain it
gets in the way of reading an already long function.

Signed-off-by: Johannes Weiner <hannes@xxxxxxxxxxx>
---
mm/memcontrol.c | 4 ----
1 file changed, 4 deletions(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 99acd6a..498c61e 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -909,10 +909,6 @@ struct mem_cgroup *mem_cgroup_iter(struct mem_cgroup *root,
*/
(void)cmpxchg(&iter->position, pos, memcg);

- /*
- * pairs with css_tryget when dereferencing iter->position
- * above.
- */
if (pos)
css_put(&pos->css);

--
2.6.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/