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]
Date:	Fri, 22 Jul 2016 11:43:30 +0800
From:	Zhou Chengming <zhouchengming1@...wei.com>
To:	<linux-kernel@...r.kernel.org>, <linux-mm@...ck.org>
CC:	<akpm@...ux-foundation.org>, <vdavydov@...tuozzo.com>,
	<riel@...hat.com>, <mhocko@...e.com>, <guohanjun@...wei.com>,
	<zhouchengming1@...wei.com>
Subject: [PATCH] update sc->nr_reclaimed after each shrink_slab

In !global_reclaim(sc) case, we should update sc->nr_reclaimed after each
shrink_slab in the loop. Because we need the correct sc->nr_reclaimed
value to see if we can break out.

Signed-off-by: Zhou Chengming <zhouchengming1@...wei.com>
---
 mm/vmscan.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index c4a2f45..47133c3 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2405,6 +2405,11 @@ static bool shrink_zone(struct zone *zone, struct scan_control *sc,
 					    memcg, sc->nr_scanned - scanned,
 					    lru_pages);
 
+			if (!global_reclaim(sc) && reclaim_state) {
+				sc->nr_reclaimed += reclaim_state->reclaimed_slab;
+				reclaim_state->reclaimed_slab = 0;
+			}
+
 			/* Record the group's reclaim efficiency */
 			vmpressure(sc->gfp_mask, memcg, false,
 				   sc->nr_scanned - scanned,
-- 
1.7.7

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ