Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1448361
| From | Zhou Chengming <zhouchengming1@huawei.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] update sc->nr_reclaimed after each shrink_slab |
| Date | 2016-07-22 05:50 +0200 |
| Message-ID | <rXzDj-hE-5@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
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@huawei.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
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH] update sc->nr_reclaimed after each shrink_slab Zhou Chengming <zhouchengming1@huawei.com> - 2016-07-22 05:50 +0200
Re: [PATCH] update sc->nr_reclaimed after each shrink_slab Michal Hocko <mhocko@kernel.org> - 2016-07-22 09:50 +0200
Re: [PATCH] update sc->nr_reclaimed after each shrink_slab Michal Hocko <mhocko@kernel.org> - 2016-07-22 10:20 +0200
csiph-web