Thread (15 messages) 15 messages, 6 authors, 2021-06-14

Re: [PATCH 5/6] mm/mremap: Use pmd/pud_poplulate to update page table entries

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2021-06-10 18:17:12

On Thu, Jun 10, 2021 at 1:36 AM Aneesh Kumar K.V
[off-list ref] wrote:
quoted hunk ↗ jump to hunk
@@ -306,8 +306,7 @@ static bool move_normal_pud(struct vm_area_struct *vma, unsigned long old_addr,

        VM_BUG_ON(!pud_none(*new_pud));

-       /* Set the new pud */
-       set_pud_at(mm, new_addr, new_pud, pud);
+       pud_populate(mm, new_pud, (pmd_t *)pud_page_vaddr(pud));
        flush_tlb_range(vma, old_addr, old_addr + PUD_SIZE);
        if (new_ptl != old_ptl)
                spin_unlock(new_ptl);
That "(pmd_t *)pud_page_vaddr(pud)" looks a bit odd and doesn't match
the pattern.

Should we perhaps have a wrapper for it? Maybe called "pud_pgtable()",
the same way we have pmd_pgtable()?

And that wrapper would be good to have a comment or two about what it
actually is. The same way that pmd_pgtable() should but doesn't ;(

            Linus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help