summaryrefslogtreecommitdiff
path: root/mm/huge_memory.c
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2018-04-27 17:13:20 -0600
committerJonathan Corbet <corbet@lwn.net>2018-04-27 17:13:20 -0600
commitccf2b067948a8f90fc3d7990c57283e7e404d004 (patch)
tree298e69b6f3e1eef45ac50ba68abe3dd175c4dc8c /mm/huge_memory.c
parente27a20f104673f8ada70c5d32430a7f4c577fe95 (diff)
parent6d08b06e67cd117f6992c46611dfb4ce267cd71e (diff)
Merge tag 'v4.17-rc2' into docs-next
Merge -rc2 to pick up the changes to Documentation/core-api/kernel-api.rst that hit mainline via the networking tree. In their absence, subsequent patches cannot be applied.
Diffstat (limited to 'mm/huge_memory.c')
-rw-r--r--mm/huge_memory.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 3e8cda7beb7f..323acdd14e6e 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -2925,7 +2925,10 @@ void remove_migration_pmd(struct page_vma_mapped_walk *pvmw, struct page *new)
pmde = maybe_pmd_mkwrite(pmde, vma);
flush_cache_range(vma, mmun_start, mmun_start + HPAGE_PMD_SIZE);
- page_add_anon_rmap(new, vma, mmun_start, true);
+ if (PageAnon(new))
+ page_add_anon_rmap(new, vma, mmun_start, true);
+ else
+ page_add_file_rmap(new, true);
set_pmd_at(mm, mmun_start, pvmw->pmd, pmde);
if (vma->vm_flags & VM_LOCKED)
mlock_vma_page(new);