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

Commit 16ef9135 authored by Minchan Kim's avatar Minchan Kim Committed by Vinayak Menon
Browse files

mm: prevent to write out dirty page in CMA by may_writepage



Now, local variable references in shrink_page_list is
PAGEREF_RECLAIM_CLEAN as default. It is for preventing to reclaim
dirty pages when CMA try to migrate pages.
Strictly speaking, we don't need it because CMA already didn't allow
to write out by .may_writepage = 0 in reclaim_clean_pages_from_list.

Morever, it has a problem to prevent anonymous pages's swap out when
we use force_reclaim = true in shrink_page_list(ex, per process reclaim
can do it)

So this patch makes references's default value to PAGEREF_RECLAIM
and declare .may_writepage = 0 of scan_control in CMA part to make
code more clear.

Change-Id: I5edc3c955d106ecebc4949ce27daf5b7b7a18089
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Mel Gorman <mgorman@suse.de>
Reported-by: default avatarMinkyung Kim <minkyung88@lge.com>
Signed-off-by: default avatarMinchan Kim <minchan@kernel.org>
Patch-mainline: linux-mm @ 9 May 2013 16:21:23
[vinmenon@codeaurora.org: trivial merge conflict fixes]
Signed-off-by: default avatarVinayak Menon <vinmenon@codeaurora.org>
parent 1cf9b916
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -983,7 +983,7 @@ static unsigned long shrink_page_list(struct list_head *page_list,
		struct address_space *mapping;
		struct page *page;
		int may_enter_fs;
		enum page_references references = PAGEREF_RECLAIM_CLEAN;
		enum page_references references = PAGEREF_RECLAIM;
		bool dirty, writeback;

		cond_resched();
@@ -1378,6 +1378,8 @@ unsigned long reclaim_clean_pages_from_list(struct zone *zone,
		.gfp_mask = GFP_KERNEL,
		.priority = DEF_PRIORITY,
		.may_unmap = 1,
		/* Doesn't allow to write out dirty page */
		.may_writepage = 0,
	};
	unsigned long ret;
	struct page *page, *next;