[Devel] [PATCH RHEL7 COMMIT] mm/memcg: Don't sleep on reparenting of every page.

Konstantin Khorenko khorenko at virtuozzo.com
Tue May 14 16:23:23 MSK 2019


The commit is pushed to "branch-rh7-3.10.0-957.12.1.vz7.95.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-957.12.1.vz7.95.5
------>
commit 2bc8961d04bad15fd62cf625aaa70787e0b60912
Author: Andrey Ryabinin <aryabinin at virtuozzo.com>
Date:   Tue May 14 16:23:22 2019 +0300

    mm/memcg: Don't sleep on reparenting of every page.
    
    Now we call schedule_timeout_uninterruptible() on reparenting of every
    single page. This makes forever for reparanting to complete. Restore
    pre-rebase behavior - schedule_timeout_uninterruptible() only on busy
    page where it's needed to prevent deadlocks.
    
    Fixes: 6c9f30adaff9 ("mm/memcg: sleep if mem_cgroup_force_empty_list() stumped
    on busy page")
    
    Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
---
 mm/memcontrol.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 4be20b81fcf8..cd31ec167f13 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -4249,7 +4249,6 @@ static void mem_cgroup_force_empty_list(struct mem_cgroup *memcg,
 		struct page_cgroup *pc;
 		struct page *page;
 
-		schedule_timeout_uninterruptible(1);
 		spin_lock_irqsave(&zone->lru_lock, flags);
 		if (list_empty(list)) {
 			spin_unlock_irqrestore(&zone->lru_lock, flags);
@@ -4269,8 +4268,11 @@ static void mem_cgroup_force_empty_list(struct mem_cgroup *memcg,
 		if (mem_cgroup_move_parent(page, pc, memcg)) {
 			/* found lock contention or "pc" is obsolete. */
 			busy = page;
-		} else
+			schedule_timeout_uninterruptible(1);
+		} else {
 			busy = NULL;
+			cond_resched();
+		}
 	} while (!list_empty(list));
 }
 



More information about the Devel mailing list