linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC] mm,vmscan: only evict file pages when we have plenty
@ 2012-10-30 18:42 Rik van Riel
  2012-10-30 18:54 ` Andrew Morton
  2012-10-31 15:39 ` Johannes Weiner
  0 siblings, 2 replies; 5+ messages in thread
From: Rik van Riel @ 2012-10-30 18:42 UTC (permalink / raw)
  To: linux-mm; +Cc: linux-kernel, klamm, akpm, mgorman, hannes

If we have more inactive file pages than active file pages, we
skip scanning the active file pages alltogether, with the idea
that we do not want to evict the working set when there is
plenty of streaming IO in the cache.

However, the code forgot to also skip scanning anonymous pages
in that situation.  That lead to the curious situation of keeping
the active file pages protected from being paged out when there
are lots of inactive file pages, while still scanning and evicting
anonymous pages.

This patch fixes that situation, by only evicting file pages
when we have plenty of them and most are inactive.

Signed-off-by: Rik van Riel <riel@redhat.com>
---
 mm/vmscan.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 2624edc..1a53fbb 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1686,6 +1686,15 @@ static void get_scan_count(struct lruvec *lruvec, struct scan_control *sc,
 			fraction[1] = 0;
 			denominator = 1;
 			goto out;
+		} else if (!inactive_file_is_low_global(zone)) {
+			/*
+			 * There is enough inactive page cache, do not
+			 * reclaim anything from the working set right now.
+			 */
+			fraction[0] = 0;
+			fraction[1] = 1;
+			denominator = 1;
+			goto out;
 		}
 	}
 

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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-10-31 16:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-30 18:42 [PATCH RFC] mm,vmscan: only evict file pages when we have plenty Rik van Riel
2012-10-30 18:54 ` Andrew Morton
2012-10-30 19:09   ` Rik van Riel
2012-10-31 15:39 ` Johannes Weiner
2012-10-31 16:17   ` Rik van Riel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).