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

Commit 20fa9d7f authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mm: vmscan: only write dirty pages that the scanner has seen twice"

parents 85b22ad5 319400b1
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -1154,14 +1154,18 @@ static unsigned long shrink_page_list(struct list_head *page_list,

		if (PageDirty(page)) {
			/*
			 * Only kswapd can writeback filesystem pages to
			 * avoid risk of stack overflow but only writeback
			 * if many dirty pages have been encountered.
			 * Only kswapd can writeback filesystem pages
			 * to avoid risk of stack overflow. But avoid
			 * injecting inefficient single-page IO into
			 * flusher writeback as much as possible: only
			 * write pages when we've encountered many
			 * dirty pages, and when we've already scanned
			 * the rest of the LRU for clean pages and see
			 * the same dirty pages again (PageReclaim).
			 */
			if (page_is_file_cache(page) &&
					(!current_is_kswapd() ||
					(pgdat &&
					 !test_bit(PGDAT_DIRTY, &pgdat->flags)))) {
			    (!current_is_kswapd() || !PageReclaim(page) ||
			     !test_bit(PGDAT_DIRTY, &pgdat->flags))) {
				/*
				 * Immediately reclaim when written back.
				 * Similar in principal to deactivate_page()