Message ID | 1491314675-15787-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
The patch series is not yet send to linux-mm. Once I get feedback on the approach used, I will resend this to linux-mm. Also if there is sufficient interest we could also get nohash hugetlb migration to work. But I avoided doing that in this series, because of my inability to test the changes. -aneesh
On 04/04/2017 07:34 PM, Aneesh Kumar K.V wrote: > The right interface to use to set a hugetlb pte entry is set_huge_pte_at. Use > that instead of set_pte_at. This is a generic change, should not mm list be added for this patch.
On Wednesday 05 April 2017 05:21 PM, Anshuman Khandual wrote: > On 04/04/2017 07:34 PM, Aneesh Kumar K.V wrote: >> The right interface to use to set a hugetlb pte entry is set_huge_pte_at. Use >> that instead of set_pte_at. > > This is a generic change, should not mm list be added for this patch. > yes to all the patches. Look for my reply to patch 1 where I mentioned the plan for linux-mm https://lists.ozlabs.org/pipermail/linuxppc-dev/2017-April/156225.html -aneesh
On 04/04/2017 07:34 PM, Aneesh Kumar K.V wrote: > The right interface to use to set a hugetlb pte entry is set_huge_pte_at. Use > that instead of set_pte_at. > Though set_huge_pte_at() calls set_pte_at() on powerpc, changing this in the generic code makes sense.
diff --git a/mm/migrate.c b/mm/migrate.c index 9a0897a14d37..4c272ac6fe53 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -224,25 +224,26 @@ static int remove_migration_pte(struct page *page, struct vm_area_struct *vma, if (is_write_migration_entry(entry)) pte = maybe_mkwrite(pte, vma); + flush_dcache_page(new); #ifdef CONFIG_HUGETLB_PAGE if (PageHuge(new)) { pte = pte_mkhuge(pte); pte = arch_make_huge_pte(pte, vma, new, 0); - } -#endif - flush_dcache_page(new); - set_pte_at(vma->vm_mm, pvmw.address, pvmw.pte, pte); - - if (PageHuge(new)) { + set_huge_pte_at(vma->vm_mm, pvmw.address, pvmw.pte, pte); if (PageAnon(new)) hugepage_add_anon_rmap(new, vma, pvmw.address); else page_dup_rmap(new, true); - } else if (PageAnon(new)) - page_add_anon_rmap(new, vma, pvmw.address, false); - else - page_add_file_rmap(new, false); + } else +#endif + { + set_pte_at(vma->vm_mm, pvmw.address, pvmw.pte, pte); + if (PageAnon(new)) + page_add_anon_rmap(new, vma, pvmw.address, false); + else + page_add_file_rmap(new, false); + } if (vma->vm_flags & VM_LOCKED && !PageTransCompound(new)) mlock_vma_page(new);
The right interface to use to set a hugetlb pte entry is set_huge_pte_at. Use that instead of set_pte_at. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> --- mm/migrate.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)