From: Zhou Chengming <zhouchengming1@huawei.com>
To: <linux-kernel@vger.kernel.org>, <linux-mm@kvack.org>
Cc: <akpm@linux-foundation.org>, <vdavydov@virtuozzo.com>,
<riel@redhat.com>, <mhocko@suse.com>, <guohanjun@huawei.com>,
<zhouchengming1@huawei.com>
Subject: [PATCH] update sc->nr_reclaimed after each shrink_slab
Date: Fri, 22 Jul 2016 11:43:30 +0800 [thread overview]
Message-ID: <1469159010-5636-1-git-send-email-zhouchengming1@huawei.com> (raw)
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
next reply other threads:[~2016-07-22 3:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-22 3:43 Zhou Chengming [this message]
2016-07-22 7:49 ` Michal Hocko
2016-07-22 8:12 ` Vladimir Davydov
2016-07-22 8:18 ` Michal Hocko
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=1469159010-5636-1-git-send-email-zhouchengming1@huawei.com \
--to=zhouchengming1@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=guohanjun@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=riel@redhat.com \
--cc=vdavydov@virtuozzo.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
all inboxes | Powered by JetHome®