mm-sparse-add-vmemmap__hvo-functions.patch removed from -mm tree
The quilt patch titled
Subject: mm/sparse: add vmemmap_*_hvo functions
has been removed from the -mm tree. Its filename was
mm-sparse-add-vmemmap__hvo-functions.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: Frank van der Linden <[email protected]>
Subject: mm/sparse: add vmemmap_*_hvo functions
Date: Fri, 28 Feb 2025 18:29:15 +0000
Add a few functions to enable early HVO:
vmemmap_populate_hvovmemmap_undo_hvovmemmap_wrprotect_hvo
The populate and undo functions are expected to be used in early init, from the sparse_init_nid_early() function. The wrprotect function is to be used, potentially, later.
To implement these functions, mostly re-use the existing compound pages vmemmap logic used by DAX. vmemmap_populate_address has its argument changed a bit in this commit: the page structure passed in to be reused in the mapping is replaced by a PFN and a flag. The flag indicates whether an extra ref should be taken on the vmemmap page containing the head page structure. Taking the ref is appropriate to for DAX / ZONE_DEVICE, but not for HugeTLB HVO.
The HugeTLB vmemmap optimization maps tail page structure pages read-only. The vmemmap_wrprotect_hvo function that does this is implemented separately, because it cannot be guaranteed that reserved page structures will not be write accessed during memory initialization. Even with CONFIG_DEFERRED_STRUCT_PAGE_INIT, they might still be written to (if they are at the bottom of a zone). So, vmemmap_populate_hvo leaves the tail page structure pages RW initially, and then later during initialization, after memmap init is fully done, vmemmap_wrprotect_hvo must be called to finish the job.
Subsequent commits will use these functions for early HugeTLB HVO.
---
include/linux/mm.h | 9 ++ mm/sparse-vmemmap.c | 141 +++++++++++++++++++++++++++++++++++++----- 2 files changed, 135 insertions(+), 15 deletions(-)
include/linux/mm.h renamed from include/linux/mm.h~mm-sparse-add-vmemmap__hvo-functions +8 -1
@@ -3937,7 +3937,8 @@ p4d_t *vmemmap_p4d_populate(pgd_t *pgd,pud_t *vmemmap_pud_populate (p4d_t *p4d,unsigned long addr,int node);pmd_t *vmemmap_pmd_populate (pud_t *pud,unsigned long addr,int node);pte_t *vmemmap_pte_populate (pmd_t *pmd,unsigned long addr,int node, -struct vmem_altmap *altmap,struct page *reuse); +struct vmem_altmap *altmap,unsigned long ptpfn, +unsigned long flags);void *vmemmap_alloc_block (unsigned long size,int node);struct vmem_altmap ; void *vmemmap_alloc_block_buf(unsigned long size, int node,
@@ -3953,6 +3954,12 @@ int vmemmap_populate_hugepages(unsigned int node, struct vmem_altmap *altmap);int vmemmap_populate (unsigned long start,unsigned long end,int node,struct vmem_altmap *altmap); +int vmemmap_populate_hvo (unsigned long start,unsigned long end,int node, +unsigned long headsize); +int vmemmap_undo_hvo (unsigned long start,unsigned long end,int node, +unsigned long headsize); +void vmemmap_wrprotect_hvo (unsigned long start,unsigned long end,int node, +unsigned long headsize);void vmemmap_populate_print_last (void );#ifdef CONFIG_MEMORY_HOTPLUG void vmemmap_free(unsigned long start, unsigned long end,
mm/sparse-vmemmap.c renamed from mm/sparse-vmemmap.c~mm-sparse-add-vmemmap__hvo-functions +127 -14
221 lines not on this page · raw message
_
Patches currently in -mm which might be from [email protected] are