linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yafang Shao <laoar.shao@gmail.com>
To: akpm@linux-foundation.org, mhocko@suse.com, anton.vorontsov@linaro.org
Cc: linux-mm@kvack.org, shaoyafang@didiglobal.com,
	Yafang Shao <laoar.shao@gmail.com>
Subject: [PATCH] mm/vmscan: call vmpressure_prio() in kswapd reclaim path
Date: Mon, 10 Jun 2019 16:42:27 +0800	[thread overview]
Message-ID: <1560156147-12314-1-git-send-email-laoar.shao@gmail.com> (raw)

Once the reclaim scanning depth goes too deep, it always mean we are
under memory pressure now.
This behavior should be captured by vmpressure_prio(), which should run
every time when the vmscan's reclaiming priority (scanning depth)
changes.
It's possible the scanning depth goes deep in kswapd reclaim path,
so vmpressure_prio() should be called in this path.

Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
---
 mm/vmscan.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index b79f584..1fbd3be 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -3609,8 +3609,11 @@ static int balance_pgdat(pg_data_t *pgdat, int order, int classzone_idx)
 		if (nr_boost_reclaim && !nr_reclaimed)
 			break;
 
-		if (raise_priority || !nr_reclaimed)
+		if (raise_priority || !nr_reclaimed) {
+			vmpressure_prio(sc.gfp_mask, sc.target_mem_cgroup,
+					sc.priority);
 			sc.priority--;
+		}
 	} while (sc.priority >= 1);
 
 	if (!sc.nr_reclaimed)
-- 
1.8.3.1


             reply	other threads:[~2019-06-10  8:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-10  8:42 Yafang Shao [this message]
2019-06-10 21:12 ` [PATCH] mm/vmscan: call vmpressure_prio() in kswapd reclaim path Andrew Morton
2019-06-11 12:24   ` Yafang Shao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1560156147-12314-1-git-send-email-laoar.shao@gmail.com \
    --to=laoar.shao@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=anton.vorontsov@linaro.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=shaoyafang@didiglobal.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).