Re: [PATCH v5 4/4] x86/mm/pat: Convert split_large_page() to use ptdescs
From: Vishal Moola (Oracle)
Date: Wed Feb 11 2026 - 17:39:03 EST
On Wed, Feb 11, 2026 at 09:59:19PM +0000, Matthew Wilcox wrote:
> On Wed, Feb 11, 2026 at 11:52:33AM -0800, Vishal Moola (Oracle) wrote:
> > static int
> > __split_large_page(struct cpa_data *cpa, pte_t *kpte, unsigned long address,
> > - struct page *base)
> > + struct ptdesc *ptdesc)
> > {
> > unsigned long lpaddr, lpinc, ref_pfn, pfn, pfninc = 1;
> > + struct page *base = ptdesc_page(ptdesc);
> > pte_t *pbase = (pte_t *)page_address(base);
>
> We have ptdesc_address() already. Can we avoid the other uses of
> 'base' in this function?
We could, but not without helpers similar to folio_pfn() and
folio_mk_pte(). I hadn't added those in this patchset since my primary
goal right now is to ensure all the allocation/free sites are using the
proper apis.