Naoya Horiguchi <n-horiguchi@xxxxxxxxxxxxx> writes: > On 02/08/2018 09:30 PM, Punit Agrawal wrote: [...] >> I'll look to update the arm64 helpers once this patch gets merged. But >> it would be helpful if there was a clear expression of semantics for >> pud_huge() for various cases. Is there any version that can be used as >> reference? > > Sorry if I misunderstand you, but with this patch there is no non-present > pud entry, so I feel that you don't have to change pud_huge() in arm64. > > When we get to have non-present pud entries (by enabling hwpoison or 1GB > hugepage migration), we need to explicitly check pud_present in every page > table walk. So I think the current semantics is like: > > if (pud_none(pud)) > /* skip this entry */ > else if (pud_huge(pud)) > /* do something for pud-hugetlb */ > else > /* go to next (pmd) level */ > > and after enabling hwpoison or migartion: > > if (pud_none(pud)) > /* skip this entry */ > else if (!pud_present(pud)) > /* do what we need to handle peculiar cases */ > else if (pud_huge(pud)) > /* do something for pud-hugetlb */ > else > /* go to next (pmd) level */ > > What we did for pmd can also be a reference to what we do for pud. Thanks for clarifying this. Based on the above - p*d_huge() should never be called with swap entries (here and in other parts of the kernel as well). If that's the case, then no change is needed for arm64. Thanks, Punit [...] -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>