[RFC PATCH 1/2] mm/pgtable: use ptdesc for pmd_huge_pte
Alex Shi
seakeel at gmail.com
Mon Dec 15 11:53:07 AEDT 2025
On 2025/12/14 14:55, alexs at kernel.org wrote:
> From: Alex Shi<alexs at kernel.org>
>
> 'pmd_huge_pte' are pgtable variables, but used 'pgtable->lru'
> instead of pgtable->pt_list in pgtable_trans_huge_deposit/withdraw
> functions, That's a bit weird.
>
> So let's convert the pgtable_t to precise 'struct ptdesc *' for
> ptdesc->pmd_huge_pte, and mm->pmd_huge_pte, then convert function
> pgtable_trans_huge_deposit() to use correct ptdesc.
>
> This convertion works for most of arch, but failed on s390/sparc/powerpc
> since they use 'pte_t *' as pgtable_t. Is there any suggestion for these
> archs? If we could have a solution, we may remove the pgtable_t for other
> archs.
If s390/sparc/powerpc can't align pgtable_t with others, we have to keep
the pgtable_t to bridge different types. But we could take step to
change pgtable_t as 'struct ptdesc *' in other archs. That could
simplify and clarify related code too, isn't it?
More information about the Linuxppc-dev
mailing list