Hi, Christophe, On Mon, Mar 11, 2024 at 09:58:47AM +0000, Christophe Leroy wrote: > Hi Peter, and nice job you are doing in cleaning up things around _huge > stuff. Thanks. I appreciate your help along the way on Power. > > One thing that might be worth looking at also at some point is the mess > around pmd_clear_huge() and pud_clear_huge(). > > I tried to clean things up with commit c742199a014d ("mm/pgtable: add > stubs for {pmd/pub}_{set/clear}_huge") but it was reverted because of > arm64 by commit d8a719059b9d ("Revert "mm/pgtable: add stubs for > {pmd/pub}_{set/clear}_huge"") > > So now powerpc/8xx has to implement pmd_clear_huge() and > pud_clear_huge() allthough 8xx page hierarchy only has 2 levels. Those are so far out of my radar, as my focus right now is still more on hugetlbfs relevant side of things, while kernel mappings are not yet directly involved in hugetlbfs, even though they're still huge mappings. It's a pity to know that broke arm and got reverted, as that looks like a good thing to clean it up if ever possible. I tend to agree with you that it seems for 3lvl we should define pgd_huge*() instead of pud_huge*(), so that it looks like the only way to provide such a treewide clean API is to properly define those APIs for aarch64, and define different pud helpers for either 3/4 levels. But I confess I don't think I fully digested all the bits. Thanks, -- Peter Xu