[Devel] [PATCH rh7] mm/memcg: Fix reparent warning again.
Andrey Ryabinin
aryabinin at virtuozzo.com
Wed Jul 17 17:17:13 MSK 2019
In case of unsuccessful reparenting reparent_attempts counter
will be -1, so intended warning will not trigger. Check diff
of ->memory - ->kmem counters instead. It's correct and easier
to read.
Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
---
mm/memcontrol.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 3fabad9d409c..acbe83875cdc 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -4379,7 +4379,8 @@ static void mem_cgroup_reparent_charges(struct mem_cgroup *memcg)
} while ((page_counter_read(&memcg->memory) -
page_counter_read(&memcg->kmem) > 0) && reparent_attempts--);
- WARN_ONCE(!reparent_attempts,
+ WARN_ONCE((page_counter_read(&memcg->memory) -
+ page_counter_read(&memcg->kmem) > 0),
"memcg 0x%p leak suspected, performed %d iterations: "
"memory=%lu, kmem=%lu",
memcg,
--
2.21.0
More information about the Devel
mailing list