From: Jiayuan Chen Proactive reclaim via memory.reclaim can run for a long time - swap I/O or thrashing again dominating the latency - and delays cgroup removal in the same way. Mitigate this by stopping the reclaim once memcg_is_dying(). Reported-by: Zhou Yingfu Cc: Jiayuan Chen Signed-off-by: Jiayuan Chen --- mm/vmscan.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/vmscan.c b/mm/vmscan.c index 8190c4abec84..1162b7f76655 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -7922,6 +7922,9 @@ int user_proactive_reclaim(char *buf, if (memcg) { unsigned int reclaim_options; + if (memcg_is_dying(memcg)) + break; + reclaim_options = MEMCG_RECLAIM_MAY_SWAP | MEMCG_RECLAIM_PROACTIVE; reclaimed = try_to_free_mem_cgroup_pages(memcg, -- 2.43.0