aboutsummaryrefslogtreecommitdiffstats
path: root/mm/rmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/rmap.c')
-rw-r--r--mm/rmap.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mm/rmap.c b/mm/rmap.c
index 99bc3f9cd796..1ea4e6fcee77 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -422,7 +422,7 @@ int page_referenced(struct page *page, int is_locked,
422 referenced += page_referenced_anon(page, mem_cont); 422 referenced += page_referenced_anon(page, mem_cont);
423 else if (is_locked) 423 else if (is_locked)
424 referenced += page_referenced_file(page, mem_cont); 424 referenced += page_referenced_file(page, mem_cont);
425 else if (TestSetPageLocked(page)) 425 else if (!trylock_page(page))
426 referenced++; 426 referenced++;
427 else { 427 else {
428 if (page->mapping) 428 if (page->mapping)
@@ -667,7 +667,8 @@ void page_remove_rmap(struct page *page, struct vm_area_struct *vma)
667 * Leaving it set also helps swapoff to reinstate ptes 667 * Leaving it set also helps swapoff to reinstate ptes
668 * faster for those pages still in swapcache. 668 * faster for those pages still in swapcache.
669 */ 669 */
670 if (page_test_dirty(page)) { 670 if ((!PageAnon(page) || PageSwapCache(page)) &&
671 page_test_dirty(page)) {
671 page_clear_dirty(page); 672 page_clear_dirty(page);
672 set_page_dirty(page); 673 set_page_dirty(page);
673 } 674 }