Skip to contentSkip to conversation

riscv-mm-align-vmemmap-to-maximal-folio-size.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Mar 24

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: riscv/mm: align vmemmap to maximal folio size
has been removed from the -mm tree. Its filename was
riscv-mm-align-vmemmap-to-maximal-folio-size.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Kiryl Shutsemau <[email protected]>
Subject: riscv/mm: align vmemmap to maximal folio size
Date: Fri, 27 Feb 2026 19:42:43 +0000

The upcoming change to the HugeTLB vmemmap optimization (HVO) requires struct pages of the head page to be naturally aligned with regard to the folio size.

Align vmemmap to the newly introduced MAX_FOLIO_VMEMMAP_ALIGN.

Cc Albert Ou <[email protected]>
Cc Alexandre Ghiti <[email protected]>
Cc Baoquan He <[email protected]>
Cc Christoph Lameter <[email protected]>
Cc David Hildenbrand (arm) <[email protected]>
Cc David Rientjes <[email protected]>
Cc Frank van der Linden <[email protected]>
Cc Harry Yoo <[email protected]>
Cc Huacai Chen <[email protected]>
Cc Johannes Weiner <[email protected]>
Cc Jonathan Corbet <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Matthew Wilcox (Oracle) <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Muchun Song <[email protected]>
Cc Oscar Salvador <[email protected]>
Cc Palmer Dabbelt <[email protected]>
Cc Paul Walmsley <[email protected]>
Cc Roman Gushchin <[email protected]>
Cc Usama Arif <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc WANG Xuerui <[email protected]>
Cc Zi Yan <[email protected]>

---

 arch/riscv/mm/init.c   |    3 ++-
 include/linux/mmzone.h |   11 +++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)
arch/riscv/mm/init.c renamed from arch/riscv/mm/init.c~riscv-mm-align-vmemmap-to-maximal-folio-size +2 -1
@@ -63,7 +63,8 @@ phys_addr_t phys_ram_base __ro_after_ini
 EXPORT_SYMBOL(phys_ram_base);
 
 #ifdef CONFIG_SPARSEMEM_VMEMMAP
-#define VMEMMAP_ADDR_ALIGN	(1ULL << SECTION_SIZE_BITS)
+#define VMEMMAP_ADDR_ALIGN	max(1ULL << SECTION_SIZE_BITS, \
+				    MAX_FOLIO_VMEMMAP_ALIGN)
 
 unsigned long vmemmap_start_pfn __ro_after_init;
 EXPORT_SYMBOL(vmemmap_start_pfn);
include/linux/mmzone.h renamed from include/linux/mmzone.h~riscv-mm-align-vmemmap-to-maximal-folio-size +11 -0
@@ -92,6 +92,17 @@
 
 #define MAX_FOLIO_NR_PAGES	(1UL << MAX_FOLIO_ORDER)
 
+/*
+ * HugeTLB Vmemmap Optimization (HVO) requires struct pages of the head page to
+ * be naturally aligned with regard to the folio size.
+ *
+ * HVO which is only active if the size of struct page is a power of 2.
+ */
+#define MAX_FOLIO_VMEMMAP_ALIGN \
+	(IS_ENABLED(CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP) && \
+	 is_power_of_2(sizeof(struct page)) ? \
+	 MAX_FOLIO_NR_PAGES * sizeof(struct page) : 0)
+
 enum migratetype {
 	MIGRATE_UNMOVABLE,
 	MIGRATE_MOVABLE,

_

Patches currently in -mm which might be from [email protected] are