aboutsummaryrefslogtreecommitdiffstats
path: root/mm/rmap.c
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2007-04-27 10:01:57 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2007-04-27 10:01:46 -0400
commit6c210482ae4a9a5bb9377ad250feaacec3faa3cd (patch)
tree2eb89d89a22380298d64edad59010c1d0a59e5a4 /mm/rmap.c
parent2fc2d1e9ffcde78af7ab63ed640d9a4901797de2 (diff)
[S390] split page_test_and_clear_dirty.
The page_test_and_clear_dirty primitive really consists of two operations, page_test_dirty and the page_clear_dirty. The combination of the two is not an atomic operation, so it makes more sense to have two separate operations instead of one. In addition to the improved readability of the s390 version of SetPageUptodate, it now avoids the page_test_dirty operation which is an insert-storage-key-extended (iske) instruction which is an expensive operation. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'mm/rmap.c')
-rw-r--r--mm/rmap.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/mm/rmap.c b/mm/rmap.c
index b82146e6dfc9..59da5b734c80 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -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 }