Re: [PATCH RFC 2/6] mm: PGTABLE_HAS_P[MU]D_LEAVES config options
From: Peter Xu
Date: Mon Aug 26 2024 - 10:35:24 EST
On Fri, Aug 23, 2024 at 06:19:52AM +0000, LEROY Christophe wrote:
> Why is an option needed for that ? If pmd_leaf() returns always false,
> it means the arch doesn't support pmd mappings and if properly used all
> related code should fold away without a config option, shouldn't it ?
It's not always easy to leverage an "if" clause there, IIUC. Take the case
of when a driver wants to inject a pmd pfnmap, we may want something like:
if (pmd_leaf_supported())
inject_pmd_leaf(&pmd);
We don't have a pmd entry to reference at the point of pmd_leaf_supported()
when making the decision.
Thanks,
--
Peter Xu