s390/mm: implement software dirty bits
[cascardo/linux.git] / mm / rmap.c
index 2c78f8c..3d38edf 100644 (file)
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -1126,7 +1126,6 @@ void page_add_file_rmap(struct page *page)
  */
 void page_remove_rmap(struct page *page)
 {
-       struct address_space *mapping = page_mapping(page);
        bool anon = PageAnon(page);
        bool locked;
        unsigned long flags;
@@ -1143,29 +1142,6 @@ void page_remove_rmap(struct page *page)
        if (!atomic_add_negative(-1, &page->_mapcount))
                goto out;
 
-       /*
-        * Now that the last pte has gone, s390 must transfer dirty
-        * flag from storage key to struct page.  We can usually skip
-        * this if the page is anon, so about to be freed; but perhaps
-        * not if it's in swapcache - there might be another pte slot
-        * containing the swap entry, but page not yet written to swap.
-        *
-        * And we can skip it on file pages, so long as the filesystem
-        * participates in dirty tracking (note that this is not only an
-        * optimization but also solves problems caused by dirty flag in
-        * storage key getting set by a write from inside kernel); but need to
-        * catch shm and tmpfs and ramfs pages which have been modified since
-        * creation by read fault.
-        *
-        * Note that mapping must be decided above, before decrementing
-        * mapcount (which luckily provides a barrier): once page is unmapped,
-        * it could be truncated and page->mapping reset to NULL at any moment.
-        * Note also that we are relying on page_mapping(page) to set mapping
-        * to &swapper_space when PageSwapCache(page).
-        */
-       if (mapping && !mapping_cap_account_dirty(mapping) &&
-           page_test_and_clear_dirty(page_to_pfn(page), 1))
-               set_page_dirty(page);
        /*
         * Hugepages are not counted in NR_ANON_PAGES nor NR_FILE_MAPPED
         * and not charged by memcg for now.