Commit 49ea7eb6 authored by Mel Gorman's avatar Mel Gorman Committed by Linus Torvalds

mm: vmscan: immediately reclaim end-of-LRU dirty pages when writeback completes

When direct reclaim encounters a dirty page, it gets recycled around the
LRU for another cycle.  This patch marks the page PageReclaim similar to
deactivate_page() so that the page gets reclaimed almost immediately after
the page gets cleaned.  This is to avoid reclaiming clean pages that are
younger than a dirty page encountered at the end of the LRU that might
have been something like a use-once page.
Signed-off-by: default avatarMel Gorman <>
Acked-by: default avatarJohannes Weiner <>
Cc: Dave Chinner <>
Cc: Christoph Hellwig <>
Cc: Wu Fengguang <>
Cc: Jan Kara <>
Cc: Minchan Kim <>
Cc: Rik van Riel <>
Cc: Mel Gorman <>
Cc: Alex Elder <>
Cc: Theodore Ts'o <>
Cc: Chris Mason <>
Cc: Dave Hansen <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 92df3a72
......@@ -100,7 +100,7 @@ enum zone_stat_item {
NR_UNSTABLE_NFS, /* NFS unstable pages */
NR_VMSCAN_IMMEDIATE, /* Prioritise for reclaim when writeback ends */
NR_WRITEBACK_TEMP, /* Writeback using temporary buffers */
NR_ISOLATED_ANON, /* Temporary isolated pages from anon lru */
NR_ISOLATED_FILE, /* Temporary isolated pages from file lru */
......@@ -866,7 +866,15 @@ static unsigned long shrink_page_list(struct list_head *page_list,
if (page_is_file_cache(page) &&
(!current_is_kswapd() || priority >= DEF_PRIORITY - 2)) {
inc_zone_page_state(page, NR_VMSCAN_WRITE_SKIP);
* Immediately reclaim when written back.
* Similar in principal to deactivate_page()
* except we already have the page isolated
* and know it's dirty
inc_zone_page_state(page, NR_VMSCAN_IMMEDIATE);
goto keep_locked;
......@@ -702,7 +702,7 @@ const char * const vmstat_text[] = {
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment