summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinchan Kim <minchan@kernel.org>2013-05-09 16:21:25 +0900
committerKyle Yan <kyan@codeaurora.org>2016-06-22 14:43:18 -0700
commit7d65fdc5d72dbf1e933ca21eb6fddaf480efdb30 (patch)
treebd85ea601883808f07f05d093a0dfdbb3564ea55
parentecc070a294b046153cf0bdb1191c0db18fdf5ed9 (diff)
mm: make shrink_page_list with pages work from multiple zones
Shrink_page_list expects all pages come from a same zone but it's too limited to use. This patch removes the dependency so next patch can use shrink_page_list with pages from multiple zones. Change-Id: I34469b7f0a79f2b79e30e40033ba8b3e1dd5f2d0 Signed-off-by: Minchan Kim <minchan@kernel.org> Patch-mainline: linux-mm @ 9 May 2013 16:21:25 [vinmenon@codeaurora.org: trivial merge conflict fixes] Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
-rw-r--r--mm/vmscan.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 5aae621bb534..b8aa077caf65 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -969,7 +969,8 @@ static unsigned long shrink_page_list(struct list_head *page_list,
goto keep;
VM_BUG_ON_PAGE(PageActive(page), page);
- VM_BUG_ON_PAGE(page_zone(page) != zone, page);
+ if (zone)
+ VM_BUG_ON_PAGE(page_zone(page) != zone, page);
sc->nr_scanned++;
@@ -1048,7 +1049,7 @@ static unsigned long shrink_page_list(struct list_head *page_list,
/* Case 1 above */
if (current_is_kswapd() &&
PageReclaim(page) &&
- test_bit(ZONE_WRITEBACK, &zone->flags)) {
+ (zone && test_bit(ZONE_WRITEBACK, &zone->flags))) {
nr_immediate++;
goto keep_locked;
@@ -1134,7 +1135,8 @@ static unsigned long shrink_page_list(struct list_head *page_list,
*/
if (page_is_file_cache(page) &&
(!current_is_kswapd() ||
- !test_bit(ZONE_DIRTY, &zone->flags))) {
+ (zone &&
+ !test_bit(ZONE_DIRTY, &zone->flags)))) {
/*
* Immediately reclaim when written back.
* Similar in principal to deactivate_page()