aboutsummaryrefslogtreecommitdiffstats
path: root/mm/filemap.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/filemap.c')
-rw-r--r--mm/filemap.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/mm/filemap.c b/mm/filemap.c
index 01690338e3d2..beba6bd6b511 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -713,8 +713,12 @@ int add_to_page_cache_lru(struct page *page, struct address_space *mapping,
713 * The page might have been evicted from cache only 713 * The page might have been evicted from cache only
714 * recently, in which case it should be activated like 714 * recently, in which case it should be activated like
715 * any other repeatedly accessed page. 715 * any other repeatedly accessed page.
716 * The exception is pages getting rewritten; evicting other
717 * data from the working set, only to cache data that will
718 * get overwritten with something else, is a waste of memory.
716 */ 719 */
717 if (shadow && workingset_refault(shadow)) { 720 if (!(gfp_mask & __GFP_WRITE) &&
721 shadow && workingset_refault(shadow)) {
718 SetPageActive(page); 722 SetPageActive(page);
719 workingset_activation(page); 723 workingset_activation(page);
720 } else 724 } else