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

Andrey Ryabinin aryabinin at virtuozzo.com
Mon Nov 30 18:26:37 MSK 2020


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 85622f235e78..240435eb6d84 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;
-- 
2.26.2



More information about the Devel mailing list