No functional changes here.

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

Signed-off-by: Konstantin Khorenko <[email protected]>
---
 mm/memcontrol.c | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 96fdce58eacc..3613c01d6bd2 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1653,18 +1653,17 @@ 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.
         */
-               position = rcu_dereference(iter->last_visited);
+       position = rcu_dereference(iter->last_visited);
+
+       /*
+        * We cannot take a reference to root because we might race
+        * with root removal and returning NULL would end up in
+        * an endless loop on the iterator user level when root
+        * would be returned all the time.
+        */
+       if (position && position != root && !css_tryget(&position->css))
+               position = NULL;
 
-               /*
-                * We cannot take a reference to root because we might race
-                * with root removal and returning NULL would end up in
-                * an endless loop on the iterator user level when root
-                * would be returned all the time.
-               */
-               if (position && position != root &&
-                               !css_tryget(&position->css))
-
-                       position = NULL;
        return position;
 }
 
-- 
2.24.3

_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to