[Devel] [PATCH RHEL7 COMMIT] Revert "mm: Port diff-mm-vmscan-disable-fs-related-activity-for-direct-direct-reclaim"

Vasily Averin vvs at virtuozzo.com
Thu Dec 3 11:29:52 MSK 2020


The commit is pushed to "branch-rh7-3.10.0-1160.6.1.vz7.171.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1160.6.1.vz7.171.1
------>
commit 8f6a892e2e8aa16231366a87e3d6969e165bbdff
Author: Andrey Ryabinin <aryabinin at virtuozzo.com>
Date:   Thu Dec 3 11:29:52 2020 +0300

    Revert "mm: Port diff-mm-vmscan-disable-fs-related-activity-for-direct-direct-reclaim"
    
    This reverts commit 50fb388878b646872b78143de3c1bf3fa6f7f148.
    Sometimes we can see a lot of reclaimable dcache and no other reclaimbale memory.
    It looks like that kswapd can't keep up reclaiming dcache fast enough.
    
    Commit 50fb388878b6 forbids to reclaim dcache in direct reclaim to prevent
    potential deadlocks that might happen due to bugs in other subsystems.
    Revert it to allow more aggressive dcache reclaim. It's unlikely to cause
    any problems since we already directly reclaim dcache in memcg reclaim,
    so let's do the same for the global one.
    
    https://jira.sw.ru/browse/PSBM-122663
    Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
---
 mm/vmscan.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 85622f2..240435e 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2653,15 +2653,9 @@ static void shrink_zone(struct zone *zone, struct scan_control *sc,
 {
 	struct reclaim_state *reclaim_state = current->reclaim_state;
 	unsigned long nr_reclaimed, nr_scanned;
-	gfp_t slab_gfp = sc->gfp_mask;
 	bool slab_only = sc->slab_only;
 	bool retry;
 
-	/* Disable fs-related IO for direct reclaim */
-	if (!sc->target_mem_cgroup &&
-	    (current->flags & (PF_MEMALLOC|PF_KSWAPD)) == PF_MEMALLOC)
-		slab_gfp &= ~__GFP_FS;
-
 	do {
 		struct mem_cgroup *root = sc->target_mem_cgroup;
 		struct mem_cgroup_reclaim_cookie reclaim = {
@@ -2695,7 +2689,7 @@ static void shrink_zone(struct zone *zone, struct scan_control *sc,
 			}
 
 			if (is_classzone) {
-				shrink_slab(slab_gfp, zone_to_nid(zone),
+				shrink_slab(sc->gfp_mask, zone_to_nid(zone),
 					    memcg, sc->priority, false);
 				if (reclaim_state) {
 					sc->nr_reclaimed += reclaim_state->reclaimed_slab;


More information about the Devel mailing list