linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Huangzhaoyang <huangzhaoyang@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Michal Hocko <mhocko@kernel.org>,
	Vladimir Davydov <vdavydov.dev@gmail.com>,
	Zhaoyang Huang <zhaoyang.huang@unisoc.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: [RFC PATCH] mm: have kswapd only reclaiming use min protection on memcg
Date: Wed, 27 Oct 2021 15:01:50 +0800	[thread overview]
Message-ID: <1635318110-1905-1-git-send-email-huangzhaoyang@gmail.com> (raw)

From: Zhaoyang Huang <zhaoyang.huang@unisoc.com>

For the kswapd only reclaiming, there is no chance to try again on
this group while direct reclaim has. fix it by judging gfp flag.

Signed-off-by: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
---
 mm/vmscan.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 74296c2..41f5776 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2704,7 +2704,8 @@ static void get_scan_count(struct lruvec *lruvec, struct scan_control *sc,
 			unsigned long protection;
 
 			/* memory.low scaling, make sure we retry before OOM */
-			if (!sc->memcg_low_reclaim && low > min) {
+			if (!sc->memcg_low_reclaim && low > min
+				&& sc->gfp_mask & __GFP_DIRECT_RECLAIM) {
 				protection = low;
 				sc->memcg_low_skipped = 1;
 			} else {
-- 
1.9.1



             reply	other threads:[~2021-10-27  7:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-27  7:01 Huangzhaoyang [this message]
2021-10-27  7:20 ` Michal Hocko
2021-10-27  7:46   ` Zhaoyang Huang
2021-10-27  8:26     ` Michal Hocko
2021-10-27  9:19       ` Zhaoyang Huang
2021-10-27 11:52         ` Michal Hocko
2021-10-27 12:05           ` Zhaoyang Huang
2021-10-27 12:31             ` Michal Hocko
2021-10-28  0:45               ` Zhaoyang Huang
2021-10-28  2:04                 ` Chris Down

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=1635318110-1905-1-git-send-email-huangzhaoyang@gmail.com \
    --to=huangzhaoyang@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=vdavydov.dev@gmail.com \
    --cc=zhaoyang.huang@unisoc.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