Skip to content

Commit

Permalink
vmscan,tmpfs: treat used once pages on tmpfs as used once
Browse files Browse the repository at this point in the history
When a page has PG_referenced, shrink_page_list() discards it only if it
is not dirty.  This rule works fine if the backing filesystem is a regular
one.  PG_dirty is a good signal that the page was used recently because
the flusher threads clean pages periodically.  In addition, page writeback
is costlier than simple page discard.

However, when a page is on tmpfs this heuristic doesn't work because
flusher threads don't write back tmpfs pages.  Consequently tmpfs pages
always rotate around the lru twice at least and adds unnecessary lru
churn.  Simple tmpfs streaming io shouldn't cause large anonymous page
swap-out.

Remove this unncessary reclaim bonus of tmpfs pages.

Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Hugh Dickins <hughd@google.com>
Reviewed-by: Johannes Weiner <hannes@cmpxchg.org>
Reviewed-by: Rik van Riel <riel@redhat.com>
Cc: Minchan Kim <minchan.kim@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
kosaki authored and torvalds committed Oct 26, 2010
1 parent 4cbec4c commit 2e30244
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ static enum page_references page_check_references(struct page *page,
}

/* Reclaim if clean, defer dirty pages to writeback */
if (referenced_page)
if (referenced_page && !PageSwapBacked(page))
return PAGEREF_RECLAIM_CLEAN;

return PAGEREF_RECLAIM;
Expand Down

0 comments on commit 2e30244

Please sign in to comment.