diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2007-04-27 16:01:57 +0200 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2007-04-27 16:01:46 +0200 |
commit | 6c210482ae4a9a5bb9377ad250feaacec3faa3cd (patch) | |
tree | 2eb89d89a22380298d64edad59010c1d0a59e5a4 /mm | |
parent | 2fc2d1e9ffcde78af7ab63ed640d9a4901797de2 (diff) | |
download | linux-6c210482ae4a9a5bb9377ad250feaacec3faa3cd.tar.bz2 |
[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')
-rw-r--r-- | mm/rmap.c | 8 |
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) struct address_space *mapping = page_mapping(page); if (mapping) ret = page_mkclean_file(mapping, page); - if (page_test_and_clear_dirty(page)) + if (page_test_dirty(page)) { + page_clear_dirty(page); ret = 1; + } } return ret; @@ -605,8 +607,10 @@ void page_remove_rmap(struct page *page, struct vm_area_struct *vma) * Leaving it set also helps swapoff to reinstate ptes * faster for those pages still in swapcache. */ - if (page_test_and_clear_dirty(page)) + if (page_test_dirty(page)) { + page_clear_dirty(page); set_page_dirty(page); + } __dec_zone_page_state(page, PageAnon(page) ? NR_ANON_PAGES : NR_FILE_MAPPED); } |