On 15.07.25 16:12, Lorenzo Stoakes wrote:
On Tue, Jul 15, 2025 at 04:06:29PM +0200, David Hildenbrand wrote:
I think at some point we discussed "when does the PMD-sized zeropage make
*any* sense on these weird arch configs" (512MiB on arm64 64bit)
No idea who wants to waste half a gig on that at runtime either.
Yeah this is a problem we _really_ need to solve. But obviously somewhat out of
scope here.
But yeah, we should let the arch code opt in whether it wants it or not (in
particular, maybe only on arm64 with CONFIG_PAGE_SIZE_4K)
I don't think this should be an ARCH_HAS_xxx.
Because that's saying 'this architecture has X', this isn't architecture
scope.
I suppose PMDs may vary in terms of how huge they are regardless of page
table size actually.
So maybe the best solution is a semantic one - just rename this to
ARCH_WANT_STATIC_PMD_ZERO_PAGE
And then put the page size selector in the arch code.
For example in arm64 we have:
select ARCH_WANT_HUGE_PMD_SHARE if ARM64_4K_PAGES || (ARM64_16K_PAGES && !ARM64_VA_BITS_36)
So doing something similar here like:
select ARCH_WANT_STATIC_PMD_ZERO_PAGE if ARM64_4K_PAGES
Would do thie job and sort everything out.
Yes.
--
Cheers,
David / dhildenb