diff options
Diffstat (limited to 'mm/rmap.c')
-rw-r--r-- | mm/rmap.c | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -1165,6 +1165,16 @@ int try_to_unmap_one(struct page *page, struct vm_area_struct *vma, | |||
1165 | } | 1165 | } |
1166 | set_pte_at(mm, address, pte, | 1166 | set_pte_at(mm, address, pte, |
1167 | swp_entry_to_pte(make_hwpoison_entry(page))); | 1167 | swp_entry_to_pte(make_hwpoison_entry(page))); |
1168 | } else if (pte_unused(pteval)) { | ||
1169 | /* | ||
1170 | * The guest indicated that the page content is of no | ||
1171 | * interest anymore. Simply discard the pte, vmscan | ||
1172 | * will take care of the rest. | ||
1173 | */ | ||
1174 | if (PageAnon(page)) | ||
1175 | dec_mm_counter(mm, MM_ANONPAGES); | ||
1176 | else | ||
1177 | dec_mm_counter(mm, MM_FILEPAGES); | ||
1168 | } else if (PageAnon(page)) { | 1178 | } else if (PageAnon(page)) { |
1169 | swp_entry_t entry = { .val = page_private(page) }; | 1179 | swp_entry_t entry = { .val = page_private(page) }; |
1170 | pte_t swp_pte; | 1180 | pte_t swp_pte; |
@@ -1360,8 +1370,9 @@ static int try_to_unmap_cluster(unsigned long cursor, unsigned int *mapcount, | |||
1360 | } | 1370 | } |
1361 | 1371 | ||
1362 | static int try_to_unmap_nonlinear(struct page *page, | 1372 | static int try_to_unmap_nonlinear(struct page *page, |
1363 | struct address_space *mapping, struct vm_area_struct *vma) | 1373 | struct address_space *mapping, void *arg) |
1364 | { | 1374 | { |
1375 | struct vm_area_struct *vma; | ||
1365 | int ret = SWAP_AGAIN; | 1376 | int ret = SWAP_AGAIN; |
1366 | unsigned long cursor; | 1377 | unsigned long cursor; |
1367 | unsigned long max_nl_cursor = 0; | 1378 | unsigned long max_nl_cursor = 0; |
@@ -1663,7 +1674,7 @@ static int rmap_walk_file(struct page *page, struct rmap_walk_control *rwc) | |||
1663 | if (list_empty(&mapping->i_mmap_nonlinear)) | 1674 | if (list_empty(&mapping->i_mmap_nonlinear)) |
1664 | goto done; | 1675 | goto done; |
1665 | 1676 | ||
1666 | ret = rwc->file_nonlinear(page, mapping, vma); | 1677 | ret = rwc->file_nonlinear(page, mapping, rwc->arg); |
1667 | 1678 | ||
1668 | done: | 1679 | done: |
1669 | mutex_unlock(&mapping->i_mmap_mutex); | 1680 | mutex_unlock(&mapping->i_mmap_mutex); |