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 754c5f5d716a..091b609cf1b1 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -7912,6 +7912,9 @@ int user_proactive_reclaim(char *buf, if (signal_pending(current)) return -EINTR; + if (memcg && memcg_is_dying(memcg)) + return -EAGAIN; + /* * This is the final attempt, drain percpu lru caches in the * hope of introducing more evictable pages. -- 2.43.0