aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/vmscan.c25
1 files changed, 2 insertions, 23 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c
index ba4e87df3fc6..d9a0e0d3aac7 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -262,27 +262,6 @@ unsigned long shrink_slab(unsigned long scanned, gfp_t gfp_mask,
262 return ret; 262 return ret;
263} 263}
264 264
265/* Called without lock on whether page is mapped, so answer is unstable */
266static inline int page_mapping_inuse(struct page *page)
267{
268 struct address_space *mapping;
269
270 /* Page is in somebody's page tables. */
271 if (page_mapped(page))
272 return 1;
273
274 /* Be more reluctant to reclaim swapcache than pagecache */
275 if (PageSwapCache(page))
276 return 1;
277
278 mapping = page_mapping(page);
279 if (!mapping)
280 return 0;
281
282 /* File is mmap'd by somebody? */
283 return mapping_mapped(mapping);
284}
285
286static inline int is_page_cache_freeable(struct page *page) 265static inline int is_page_cache_freeable(struct page *page)
287{ 266{
288 /* 267 /*
@@ -606,7 +585,7 @@ static enum page_references page_check_references(struct page *page,
606 if (vm_flags & VM_LOCKED) 585 if (vm_flags & VM_LOCKED)
607 return PAGEREF_RECLAIM; 586 return PAGEREF_RECLAIM;
608 587
609 if (page_mapping_inuse(page)) 588 if (page_mapped(page))
610 return PAGEREF_ACTIVATE; 589 return PAGEREF_ACTIVATE;
611 590
612 /* Reclaim if clean, defer dirty pages to writeback */ 591 /* Reclaim if clean, defer dirty pages to writeback */
@@ -1381,7 +1360,7 @@ static void shrink_active_list(unsigned long nr_pages, struct zone *zone,
1381 } 1360 }
1382 1361
1383 /* page_referenced clears PageReferenced */ 1362 /* page_referenced clears PageReferenced */
1384 if (page_mapping_inuse(page) && 1363 if (page_mapped(page) &&
1385 page_referenced(page, 0, sc->mem_cgroup, &vm_flags)) { 1364 page_referenced(page, 0, sc->mem_cgroup, &vm_flags)) {
1386 nr_rotated++; 1365 nr_rotated++;
1387 /* 1366 /*