On Fri, Jun 24, 2022 at 11:47 AM Matthew Wilcox <willy@xxxxxxxxxxxxx> wrote: > > On Fri, Jun 24, 2022 at 05:36:30PM +0000, James Houghton wrote: > > - Page table walking and manipulation > > A new function, hugetlb_walk_to, handles walking HugeTLB page tables for > > high-granularity mappings. Eventually, it's possible to merge > > hugetlb_walk_to with huge_pte_offset and huge_pte_alloc. > > > > We keep track of HugeTLB page table entries with a new struct, hugetlb_pte. > > This is because we generally need to know the "size" of a PTE (previously > > always just huge_page_size(hstate)). > > > > For every page table manipulation function that has a huge version (e.g. > > huge_ptep_get and ptep_get), there is a wrapper for it (e.g. > > hugetlb_ptep_get). The correct version is used depending on if a HugeTLB > > PTE really is "huge". > > I'm disappointed to hear that page table walking is going to become even > more special. I'd much prefer it if hugetlb walking were exactly the > same as THP walking. This seems like a good time to do at least some > of that work. > > Was there a reason you chose the "more complexity" direction? I chose this direction because it seemed to be the most straightforward to get to a working prototype and then to an RFC. I agree with your sentiment -- I'll see what I can do to reconcile THP walking with HugeTLB(+HGM) walking.