On Thu, Jan 30, 2025 at 10:36:51PM +0100, Oscar Salvador wrote: > HugeTLB has its own way of dealing with things. > E.g: HugeTLB interprets everything as a pte: huge_pte_uffd_wp, huge_pte_clear_uffd_wp, > huge_pte_dirty, huge_pte_modify, huge_pte_wrprotect etc. This is a bug, not a feature. It makes some horrendous assumptions about how each architecture encodes its ptes/pmd/puds (ie they're all compatible). By and large they're mostly compatible, but there are some awful hacks to work around the cases where they aren't. > One of the challenges that this raises is that if we want pmd/pud walkers to > be able to make sense of hugetlb stuff, we need to implement pud/pmd > (maybe some pmd we already have because of THP) variants of those. That's a good thing! typesafety is good! hugetlbfs tries to defeat it and it works rather too well.