On Sun, Jun 13, 2021 at 2:06 AM Aneesh Kumar K.V <aneesh.kumar@xxxxxxxxxxxxx> 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. Honestly, the same confusion is real - in a different way - about pud_page_vaddr(). I really hate that function. Just grep for the uses, and the definitions, to see what I mean. It's crazy. I'm perfectly happy not having a "pud_pagetable()" function, but that cast on pud_page_vaddr() is indicative of real problems. One solution might be to just say "pud_page_vaddr()" must return a "pmd_t *". I think it's what all the users actually want anyway. Linus