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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1691402476-4838-1-git-send-email-hyeongtak.ji@gmail.com>
Date:   Mon,  7 Aug 2023 19:01:16 +0900
From:   Hyeongtak Ji <hyeongtak.ji@...il.com>
To:     akpm@...ux-foundation.org
Cc:     linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        Hyeongtak Ji <hyeongtak.ji@...il.com>,
        Hyeongtak Ji <hyeongtak.ji@...com>
Subject: [PATCH] mm/vmscan: consider previously reclaimed pages in shrink_lruvec()

shrink_lruvec() currently ignores previously reclaimed pages in
scan_control->nr_reclaimed.  This can lead shrink_lruvec() to reclaiming
more pages than expected.

This patch fixes shrink_lruvec() to take into account the previously
reclaimed pages.

Signed-off-by: Hyeongtak Ji <hyeongtak.ji@...com>
---
 mm/vmscan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 1080209a568b..315da4ae16f1 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -6261,7 +6261,7 @@ static void shrink_lruvec(struct lruvec *lruvec, struct scan_control *sc)
 	unsigned long nr_to_scan;
 	enum lru_list lru;
 	unsigned long nr_reclaimed = 0;
-	unsigned long nr_to_reclaim = sc->nr_to_reclaim;
+	unsigned long nr_to_reclaim = sc->nr_to_reclaim - sc->nr_reclaimed;
 	bool proportional_reclaim;
 	struct blk_plug plug;
 
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ