diff options
Diffstat (limited to 'mm/rmap.c')
-rw-r--r-- | mm/rmap.c | 24 |
1 files changed, 0 insertions, 24 deletions
@@ -1126,7 +1126,6 @@ void page_add_file_rmap(struct page *page) | |||
1126 | */ | 1126 | */ |
1127 | void page_remove_rmap(struct page *page) | 1127 | void page_remove_rmap(struct page *page) |
1128 | { | 1128 | { |
1129 | struct address_space *mapping = page_mapping(page); | ||
1130 | bool anon = PageAnon(page); | 1129 | bool anon = PageAnon(page); |
1131 | bool locked; | 1130 | bool locked; |
1132 | unsigned long flags; | 1131 | unsigned long flags; |
@@ -1144,29 +1143,6 @@ void page_remove_rmap(struct page *page) | |||
1144 | goto out; | 1143 | goto out; |
1145 | 1144 | ||
1146 | /* | 1145 | /* |
1147 | * Now that the last pte has gone, s390 must transfer dirty | ||
1148 | * flag from storage key to struct page. We can usually skip | ||
1149 | * this if the page is anon, so about to be freed; but perhaps | ||
1150 | * not if it's in swapcache - there might be another pte slot | ||
1151 | * containing the swap entry, but page not yet written to swap. | ||
1152 | * | ||
1153 | * And we can skip it on file pages, so long as the filesystem | ||
1154 | * participates in dirty tracking (note that this is not only an | ||
1155 | * optimization but also solves problems caused by dirty flag in | ||
1156 | * storage key getting set by a write from inside kernel); but need to | ||
1157 | * catch shm and tmpfs and ramfs pages which have been modified since | ||
1158 | * creation by read fault. | ||
1159 | * | ||
1160 | * Note that mapping must be decided above, before decrementing | ||
1161 | * mapcount (which luckily provides a barrier): once page is unmapped, | ||
1162 | * it could be truncated and page->mapping reset to NULL at any moment. | ||
1163 | * Note also that we are relying on page_mapping(page) to set mapping | ||
1164 | * to &swapper_space when PageSwapCache(page). | ||
1165 | */ | ||
1166 | if (mapping && !mapping_cap_account_dirty(mapping) && | ||
1167 | page_test_and_clear_dirty(page_to_pfn(page), 1)) | ||
1168 | set_page_dirty(page); | ||
1169 | /* | ||
1170 | * Hugepages are not counted in NR_ANON_PAGES nor NR_FILE_MAPPED | 1146 | * Hugepages are not counted in NR_ANON_PAGES nor NR_FILE_MAPPED |
1171 | * and not charged by memcg for now. | 1147 | * and not charged by memcg for now. |
1172 | */ | 1148 | */ |