[Devel] [PATCH RHEL7 COMMIT] mm/memcg: don't swap cgroup's pages during offline
Konstantin Khorenko
khorenko at virtuozzo.com
Mon Aug 13 15:39:51 MSK 2018
The commit is pushed to "branch-rh7-3.10.0-862.9.1.vz7.70.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-862.9.1.vz7.70.2
------>
commit 392997f5b59e09a03439da099c8e57366c50665b
Author: Andrey Ryabinin <aryabinin at virtuozzo.com>
Date: Mon Aug 13 15:39:51 2018 +0300
mm/memcg: don't swap cgroup's pages during offline
During rmdir of memory cgroup we might have a lot of anonymous pages
(e.g. KSM merged them a lot). Currently our offline cgroup callback
will try to swap them out to release mem cgroup sooner. But this
can take a while, and we do this under global cgroup mutex.
Also forcefully swapping such pages is just bad as they might
be actively in use. So just reclaim without swapping in offline
callback.
https://jira.sw.ru/browse/PSBM-87281
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 8b979d88045c..2a0f7fc159aa 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -6187,7 +6187,8 @@ static void mem_cgroup_free_all(struct mem_cgroup *memcg)
lru_add_drain_all();
while (nr_retries && page_counter_read(&memcg->memory))
- if (!try_to_free_mem_cgroup_pages(memcg, -1UL, GFP_KERNEL, 0))
+ if (!try_to_free_mem_cgroup_pages(memcg, -1UL, GFP_KERNEL,
+ MEM_CGROUP_RECLAIM_NOSWAP))
nr_retries--;
lru_add_drain();
More information about the Devel
mailing list