[PATCH] vmscan,tmpfs: treat used once pages on tmpfs as used once

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When a page has PG_referenced, shrink_page_list() discard it only
if it is no dirty. This rule works completely fine if the backend
filesystem is regular one. PG_dirty is good signal that it was used
recently because flusher thread clean pages periodically. In addition,
page writeback is costly rather than simple page discard.

However, When a page is on tmpfs, this heuristic don't works because
flusher thread don't writeback tmpfs pages. then, tmpfs pages always
rotate lru twice at least and it makes unnecessary lru churn. Merely
tmpfs streaming io shouldn't cause large anonymous page swap-out.

This patch remove this unncessary reclaim bonus of tmpfs pages.

Cc: Hugh Dickins <hughd@xxxxxxxxxx>
Cc: Johannes Weiner <hannes@xxxxxxxxxxx>
Cc: Rik van Riel <riel@xxxxxxxxxx>
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx>
---
 mm/vmscan.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 1919d8a..aba3402 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -617,7 +617,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;
-- 
1.6.5.2



--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxxx  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]