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

Submitted by Vasily Averin on Dec. 3, 2020, 8:29 a.m.


Message ID 202012030829.0B38Tqjq021458@vz7build.vvs.sw.ru
State New
Series "Revert "mm: Port diff-mm-vmscan-disable-fs-related-activity-for-direct-direct-reclaim""
Headers show

Commit Message

Vasily Averin Dec. 3, 2020, 8:29 a.m.
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@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.
    Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
 mm/vmscan.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

Patch hide | download patch | download mbox

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;