Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6ea73f4f authored by Minchan Kim's avatar Minchan Kim Committed by Vinayak Menon
Browse files

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: default avatarMinchan Kim <minchan@kernel.org>
Patch-mainline: linux-mm @ 9 May 2013 16:21:25
[vinmenon@codeaurora.org: trivial merge conflict fixes]
Signed-off-by: default avatarVinayak Menon <vinmenon@codeaurora.org>
parent 5448f264
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -903,6 +903,7 @@ static unsigned long shrink_page_list(struct list_head *page_list,
			goto keep;

		VM_BUG_ON_PAGE(PageActive(page), page);
		if (zone)
			VM_BUG_ON_PAGE(page_zone(page) != zone, page);

		sc->nr_scanned++;
@@ -985,7 +986,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;

@@ -1067,7 +1068,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()