[Devel] [PATCH RHEL7 COMMIT] mm/memcg: Fix potential softlockup during memcgroup shutdown.

Konstantin Khorenko khorenko at virtuozzo.com
Mon Oct 30 17:44:51 MSK 2017


The commit is pushed to "branch-rh7-3.10.0-693.1.1.vz7.37.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-693.1.1.vz7.37.20
------>
commit 9bd767bbdd723732317571ec69ea08f13cefea43
Author: Andrey Ryabinin <aryabinin at virtuozzo.com>
Date:   Mon Oct 30 17:44:51 2017 +0300

    mm/memcg: Fix potential softlockup during memcgroup shutdown.
    
    On a huge mem cgroup mem_cgroup_force_empty_list() may iterate
    for a long time without rescheduling and cause softlockup.
    Add cond_resched() to avoid this.
    
    https://jira.sw.ru/browse/PSBM-76011
    Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
---
 mm/memcontrol.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index efc455d..a7fa84a 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -4038,8 +4038,10 @@ static void mem_cgroup_force_empty_list(struct mem_cgroup *memcg,
 			/* found lock contention or "pc" is obsolete. */
 			busy = page;
 			schedule_timeout_uninterruptible(1);
-		} else
+		} else {
 			busy = NULL;
+			cond_resched();
+		}
 	} while (!list_empty(list));
 }
 


More information about the Devel mailing list