|
@@ -1679,13 +1679,24 @@ static void get_scan_count(struct lruvec *lruvec, struct scan_control *sc,
|
|
|
|
|
|
if (global_reclaim(sc)) {
|
|
|
free = zone_page_state(zone, NR_FREE_PAGES);
|
|
|
- /* If we have very few page cache pages,
|
|
|
- force-scan anon 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;
|
|
|
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;
|
|
|
}
|
|
|
}
|
|
|
|