[Devel] [PATCH rh7 v4 7/9] mm/mem_cgroup_iter: Don't bother checking 'dead_count' anymore

Konstantin Khorenko khorenko at virtuozzo.com
Wed Feb 24 21:55:39 MSK 2021


As we've enhanced mem_cgroup_iter_invalidate() to NULL-ify
'last_visited' if it stored dying cgroups, we can be sure
iter->last_visited always contain valid pointer to memcg
(or NULL surely).

So just skip extra check iter->last_dead_count vs root->dead_count,
it's not needed anymore.

Note: the patch is prepared as small as possible - for review simplicity.
Cleanup patch will follow.

https://jira.sw.ru/browse/PSBM-123655

Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
---
 mm/memcontrol.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index c17fa6aaa7ad..cdb7f6f4c994 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1653,8 +1653,6 @@ mem_cgroup_iter_load(struct mem_cgroup_reclaim_iter *iter,
 	 * offlining.  The RCU lock ensures the object won't be
 	 * released, tryget will fail if we lost the race.
 	 */
-	*sequence = atomic_read(&root->dead_count);
-	if (iter->last_dead_count == *sequence) {
 		position = rcu_dereference(iter->last_visited);
 
 		/*
@@ -1667,7 +1665,6 @@ mem_cgroup_iter_load(struct mem_cgroup_reclaim_iter *iter,
 				!css_tryget(&position->css))
 
 			position = NULL;
-	}
 	return position;
 }
 
-- 
2.24.3



More information about the Devel mailing list