Re: [PATCHv3 2/4] x86/64/mm: Make SPARSEMEM_VMEMMAP the only memory model

From: Dave Hansen
Date: Fri May 16 2025 - 11:13:54 EST


On 5/16/25 07:59, Dave Hansen wrote:
> The only option would be to make them static when using non-vmemmap
> sparsemem. But that's new-ish, and probably won't get any testing.

Something like this. But I don't particularly like it.

---

b/arch/x86/include/asm/sparsemem.h | 4 ++++
1 file changed, 4 insertions(+)

diff -puN arch/x86/include/asm/sparsemem.h~static-sparsemem-0 arch/x86/include/asm/sparsemem.h
--- a/arch/x86/include/asm/sparsemem.h~static-sparsemem-0 2025-05-16 08:05:19.006150139 -0700
+++ b/arch/x86/include/asm/sparsemem.h 2025-05-16 08:07:14.517189024 -0700
@@ -26,7 +26,11 @@
# endif
#else /* CONFIG_X86_32 */
# define SECTION_SIZE_BITS 27 /* matt - 128 is convenient right now */
+#ifdef CONFIG_SPARSEMEM_VMEMMAP
# define MAX_PHYSMEM_BITS (pgtable_l5_enabled() ? 52 : 46)
+# else
+# define MAX_PHYSMEM_BITS 46
+# endif
#endif

#endif /* CONFIG_SPARSEMEM */
_