summaryrefslogtreecommitdiffstats
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 7a4e20e21..0971c63b7 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -150,6 +150,10 @@ int shrink_mmap(int priority, int gfp_mask)
}
tmp = tmp->b_this_page;
} while (tmp != bh);
+
+ /* Refuse to swap out all buffer pages */
+ if ((buffermem >> PAGE_SHIFT) * 100 < (buffer_mem.min_percent * num_physpages))
+ goto next;
}
/* We can't throw away shared pages, but we do mark
@@ -167,7 +171,7 @@ int shrink_mmap(int priority, int gfp_mask)
break;
}
age_page(page);
- if (page->age)
+ if (page->age || page_cache_size * 100 < (page_cache.min_percent * num_physpages))
break;
if (PageSwapCache(page)) {
delete_from_swap_cache(page);