From: Hillf Danton <dhillf@gmail.com>
To: linux-mm@kvack.org
Cc: Michal Hocko <mhocko@suse.cz>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
Ying Han <yinghan@google.com>, Hugh Dickins <hughd@google.com>,
Andrew Morton <akpm@linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>,
Hillf Danton <dhillf@gmail.com>
Subject: [PATCH] mm: vmscan: ensure reclaiming pages on the lru lists of zone
Date: Sun, 22 Jan 2012 11:08:20 +0800 [thread overview]
Message-ID: <CAJd=RBC8dCGgqXqP+yjW2+pVoSeFXwXfjx8DLHhMuY8goOadZw@mail.gmail.com> (raw)
It is possible that the memcg input into shrink_mem_cgroup_zone() in
each round is not NULL, and the loop terminates at NULL case. And there
is chance that pages on the lru lists of zone are not reclaimed.
Mem cgroup iteration is refactored a bit to ensure the NULL case is also
input into the function.
Signed-off-by: Hillf Danton <dhillf@gmail.com>
---
--- a/mm/vmscan.c Sat Jan 14 14:02:20 2012
+++ b/mm/vmscan.c Sun Jan 22 10:09:32 2012
@@ -2142,14 +2142,14 @@ static void shrink_zone(int priority, st
.zone = zone,
.priority = priority,
};
- struct mem_cgroup *memcg;
+ struct mem_cgroup_zone mz = {
+ .zone = zone,
+ };
+ struct mem_cgroup *memcg = NULL;
- memcg = mem_cgroup_iter(root, NULL, &reclaim);
do {
- struct mem_cgroup_zone mz = {
- .mem_cgroup = memcg,
- .zone = zone,
- };
+ memcg = mem_cgroup_iter(root, memcg, &reclaim);
+ mz.mem_cgroup = memcg,
shrink_mem_cgroup_zone(priority, &mz, sc);
/*
@@ -2166,7 +2166,6 @@ static void shrink_zone(int priority, st
mem_cgroup_iter_break(root, memcg);
break;
}
- memcg = mem_cgroup_iter(root, memcg, &reclaim);
} while (memcg);
}
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next reply other threads:[~2012-01-22 3:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-22 3:08 Hillf Danton [this message]
2012-01-22 16:47 ` Hillf Danton
2012-01-23 11:20 ` Johannes Weiner
2012-01-23 11:53 ` Hillf Danton
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='CAJd=RBC8dCGgqXqP+yjW2+pVoSeFXwXfjx8DLHhMuY8goOadZw@mail.gmail.com' \
--to=dhillf@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=hughd@google.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.cz \
--cc=yinghan@google.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