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

2021-06-10 Thread Aneesh Kumar K.V
pmd/pud_populate is the right interface to be used to set the respective page table entries. Some architectures like ppc64 do assume that set_pmd/pud_at can only be used to set a hugepage PTE. Since we are not setting up a hugepage PTE here, use the pmd/pud_populate interface. Signed-off-by: Anees

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

2021-06-10 Thread Linus Torvalds
On Thu, Jun 10, 2021 at 1:36 AM Aneesh Kumar K.V wrote: > > @@ -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); > +

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

2021-06-13 Thread Aneesh Kumar K.V
Linus Torvalds writes: > On Thu, Jun 10, 2021 at 1:36 AM Aneesh Kumar K.V > wrote: >> >> @@ -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

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

2021-06-13 Thread Matthew Wilcox
On Sun, Jun 13, 2021 at 02:36:13PM +0530, Aneesh Kumar K.V wrote: > IIUC the reason why we do have pmd_pgtable() is that pgtable_t type > is arch dependent. On some architecture it is pte_t * and on the other > struct page *. The reason being highmem and level 4 page table can > be located in highm

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

2021-06-13 Thread Aneesh Kumar K.V
On 6/13/21 4:20 PM, Matthew Wilcox wrote: On Sun, Jun 13, 2021 at 02:36:13PM +0530, Aneesh Kumar K.V wrote: IIUC the reason why we do have pmd_pgtable() is that pgtable_t type is arch dependent. On some architecture it is pte_t * and on the other struct page *. The reason being highmem and level

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

2021-06-13 Thread Linus Torvalds
On Sun, Jun 13, 2021 at 2:06 AM Aneesh Kumar K.V wrote: > > IIUC the reason why we do have pmd_pgtable() is that pgtable_t type > is arch dependent. On some architecture it is pte_t * and on the other > struct page *. The reason being highmem and level 4 page table can > be located in highmem. Ho

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

2021-06-13 Thread Christophe Leroy
Le 13/06/2021 à 13:13, Aneesh Kumar K.V a écrit : On 6/13/21 4:20 PM, Matthew Wilcox wrote: On Sun, Jun 13, 2021 at 02:36:13PM +0530, Aneesh Kumar K.V wrote: IIUC the reason why we do have pmd_pgtable() is that pgtable_t type is arch dependent. On some architecture it is pte_t * and on the o