diff options
Diffstat (limited to 'mm/rmap.c')
-rw-r--r-- | mm/rmap.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -498,8 +498,10 @@ int page_mkclean(struct page *page) | |||
498 | struct address_space *mapping = page_mapping(page); | 498 | struct address_space *mapping = page_mapping(page); |
499 | if (mapping) | 499 | if (mapping) |
500 | ret = page_mkclean_file(mapping, page); | 500 | ret = page_mkclean_file(mapping, page); |
501 | if (page_test_and_clear_dirty(page)) | 501 | if (page_test_dirty(page)) { |
502 | page_clear_dirty(page); | ||
502 | ret = 1; | 503 | ret = 1; |
504 | } | ||
503 | } | 505 | } |
504 | 506 | ||
505 | return ret; | 507 | return ret; |
@@ -605,8 +607,10 @@ void page_remove_rmap(struct page *page, struct vm_area_struct *vma) | |||
605 | * Leaving it set also helps swapoff to reinstate ptes | 607 | * Leaving it set also helps swapoff to reinstate ptes |
606 | * faster for those pages still in swapcache. | 608 | * faster for those pages still in swapcache. |
607 | */ | 609 | */ |
608 | if (page_test_and_clear_dirty(page)) | 610 | if (page_test_dirty(page)) { |
611 | page_clear_dirty(page); | ||
609 | set_page_dirty(page); | 612 | set_page_dirty(page); |
613 | } | ||
610 | __dec_zone_page_state(page, | 614 | __dec_zone_page_state(page, |
611 | PageAnon(page) ? NR_ANON_PAGES : NR_FILE_MAPPED); | 615 | PageAnon(page) ? NR_ANON_PAGES : NR_FILE_MAPPED); |
612 | } | 616 | } |