[PATCH] mm/pgtable: convert pgtable_t to ptdesc pointer
Alex Shi
seakeel at gmail.com
Wed Jan 7 01:28:36 PST 2026
On 2026/1/7 17:05, Mike Rapoport wrote:
> On Wed, Jan 07, 2026 at 02:46:35PM +0800,alexs at kernel.org wrote:
>> From: Alex Shi<alexs at kernel.org>
>>
>> After struct ptdesc introduced, pgtable_t should used it instead of old
>> struct page pointer. The only thing in the way for this change is just
>> pgtable->lru in pgtable_trans_huge_deposit/withdraw.
>>
>> Let's convert them into ptdesc and use struct ptdesc* as pgtable_t.
>> Thanks testing support from kernel test robot<lkp at intel.com>
>>
>> Signed-off-by: Alex Shi<alexs at kernel.org>
>> ---
> ...
>
>> diff --git a/arch/arm/include/asm/pgalloc.h b/arch/arm/include/asm/pgalloc.h
>> index a17f01235c29..1a3484c2df4c 100644
>> --- a/arch/arm/include/asm/pgalloc.h
>> +++ b/arch/arm/include/asm/pgalloc.h
>> @@ -96,12 +96,12 @@ pte_alloc_one(struct mm_struct *mm)
>> {
>> struct page *pte;
>>
>> - pte = __pte_alloc_one(mm, GFP_PGTABLE_USER | PGTABLE_HIGHMEM);
>> + pte = ptdesc_page(__pte_alloc_one(mm, GFP_PGTABLE_USER | PGTABLE_HIGHMEM));
> When ptdesc will be separated from struct page, ptdesc_page() would fail if the
> allocation failed. This line should be split into something like
>
> struct ptdesc *ptdesc = __pte_alloc_one(...);
> if (!ptesc)
> return NULL;
> pte = ptdesc_page(ptdesc);
>
>
Right, I will fix this. and sent the 2nd version.
Thanks a lot!
>> if (!pte)
>> return NULL;
>> if (!PageHighMem(pte))
>> clean_pte_table(page_address(pte));
>> - return pte;
>> + return page_ptdesc(pte);
>> }
>>
>> static inline void __pmd_populate(pmd_t *pmdp, phys_addr_t pte,
> -- Sincerely yours, Mike.
>
More information about the linux-snps-arc
mailing list