lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1635318110-1905-1-git-send-email-huangzhaoyang@gmail.com>
Date:   Wed, 27 Oct 2021 15:01:50 +0800
From:   Huangzhaoyang <huangzhaoyang@...il.com>
To:     Andrew Morton <akpm@...ux-foundation.org>,
        Johannes Weiner <hannes@...xchg.org>,
        Michal Hocko <mhocko@...nel.org>,
        Vladimir Davydov <vdavydov.dev@...il.com>,
        Zhaoyang Huang <zhaoyang.huang@...soc.com>, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org
Subject: [RFC PATCH] mm: have kswapd only reclaiming use min protection on memcg

From: Zhaoyang Huang <zhaoyang.huang@...soc.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@...soc.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ