aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Weiner <[email protected]>2013-02-22 16:32:15 -0800
committerLinus Torvalds <[email protected]>2013-02-23 17:50:09 -0800
commit11d16c25bbf7a3b7a43d7472e175cdd52961757d (patch)
tree6e87963a0373ac627500baa84ff43164fee46bc7
parent10316b313cbde4b778c3d1b4b2fe2adbcbe84a48 (diff)
mm: vmscan: improve comment on low-page cache handling
Fix comment style and elaborate on why anonymous memory is force-scanned when file cache runs low. Signed-off-by: Johannes Weiner <[email protected]> Reviewed-by: Rik van Riel <[email protected]> Acked-by: Mel Gorman <[email protected]> Reviewed-by: Michal Hocko <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: Satoru Moriya <[email protected]> Cc: Simon Jeons <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--mm/vmscan.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 68586c887611..259f8208a388 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1713,13 +1713,15 @@ static void get_scan_count(struct lruvec *lruvec, struct scan_control *sc,
file = get_lru_size(lruvec, LRU_ACTIVE_FILE) +
get_lru_size(lruvec, LRU_INACTIVE_FILE);
+ /*
+ * If it's foreseeable that reclaiming the file cache won't be
+ * enough to get the zone back into a desirable shape, we have
+ * to swap. Better start now and leave the - probably heavily
+ * thrashing - remaining file pages alone.
+ */
if (global_reclaim(sc)) {
- free = zone_page_state(zone, NR_FREE_PAGES);
+ free = zone_page_state(zone, NR_FREE_PAGES);
if (unlikely(file + free <= high_wmark_pages(zone))) {
- /*
- * If we have very few page cache pages, force-scan
- * anon pages.
- */
fraction[0] = 1;
fraction[1] = 0;
denominator = 1;