From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794023399; b=1Qh12NWi8gfxpImy3ITCSLZoaSiDdQXSBf9fQGrucKxuOmER+9eqPYJ9U+ZIQDWrAb8J 2Iz6OZEk9Uup0Vy/zl2N7EIOhaeFLv8jhexMl2kQSV7/OzUt+Cd75SCGXrDX4cqQyTKLF 2dphv/nKPRVSMpL5c92kEOswOCInXPqYDda5ydmrAN6/Pt3z4iCwtTWQDZxXyONXKWkfU os8rgT71hkx7fTTtbLtDh2wza4yCUtzMSJ1NK1mlxmaWePrmabBbAFQV8r+gVYnHeHTL8 MyxLj6nzdcH4INU1K8ruuRD6kKTbck1raEo4j28TZgY+lxsl9Kcgw0ENgh1V9oHffUQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794023399; h=Received:DKIM-Signature:Date:To:From:Subject:Message-Id; bh=968O9MDDl5zFk1+I5liJ2paBR5FO1Qr5utS7oFxzNAg=; b=0tjGxykG/rHYJjX1DwqJifIuP5kYPfhx34OD0zU8s7SRUV+Y23YSe86jDUTReoNbbtrX a8I+tqWaPi00Jj8Y/ViPlE2gEX5F42QscjFhv7ZJcCu0Ghm8KWL4uNhWgtHpzPc6JobHy kHTJ0meJPMZ1YSPaphhdaVcBpEFJ0xgs1H3jrO81Ii7k7FIaeVisNC5JGWMnfEcIkYNK3 Q8KPQ5f0DjTJBU4bw7FdGwtDXQ4j5CfiFoIbhIolGR1cY8skAN/yEhf7oMIqqnkIm523x 1p20zfqBPrTUhk5m0B6SJo5ziKkuQit3+SEc7lkLQHpxgNupm5H3+DQ3FlVvEP0/EMw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=qoA28dcT; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BFC3A606A32F for ; Sat, 7 Nov 2026 03:49:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=qoA28dcT Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8A55C1F0089F; Sat, 7 Nov 2026 03:49:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1794023398; bh=968O9MDDl5zFk1+I5liJ2paBR5FO1Qr5utS7oFxzNAg=; h=Date:To:From:Subject; b=qoA28dcTRjOPG3AWez2bjbiJRCWxAAQmNB0umCPXkbFIyL38atVAKXsS4lKK9u7aB VtcybpHAv2TUePtuMQhP5/t/uZM+t2dKljvtqQP6tmQKC78KUIyN/UJB5aansavAGB YOO5h6vGU9ffwDevxe9Do1H/Yi5d6K5O/tr41LX0= Date: Fri, 06 Nov 2026 19:49:58 -0800 To: mm-commits@vger.kernel.org,muchun.song@linux.dev,akpm@linux-foundation.org From: Andrew Morton Subject: [to-be-updated] mm-hugetlb_vmemmap-make-vmemmap-pte-conversion-folio-oriented.patch removed from -mm tree Message-Id: <20261107034958.8A55C1F0089F@smtp.kernel.org> X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list The quilt patch titled Subject: mm: hugetlb_vmemmap: make vmemmap PTE conversion folio-oriented has been removed from the -mm tree. Its filename was mm-hugetlb_vmemmap-make-vmemmap-pte-conversion-folio-oriented.patch This patch was dropped because an updated version will be issued ------------------------------------------------------ From: Muchun Song Subject: mm: hugetlb_vmemmap: make vmemmap PTE conversion folio-oriented Date: Wed, 04 Nov 2026 10:35:10 +0800 Converting a folio's vmemmap mappings from PMDs to PTEs is a per-folio operation, but the current interface exposes a raw address range and hardcodes deferred TLB flushing. This splits the common mechanism across layers and couples it to the HugeTLB batching policy. Make the folio the unit of PTE conversion and let callers select the TLB flush policy through the folio-oriented interface. This keeps HugeTLB-specific eligibility and batching outside the common operation. No functional change intended. Link: https://lore.kernel.org/20261104023510.260766-13-songmuchun@bytedance.com Signed-off-by: Muchun Song Signed-off-by: Andrew Morton Reviewed-by: Lance Yang Reviewed-by: Qi Zheng Reviewed-by: Mike Rapoport (Microsoft) Tested-by: Andrew Morton Link: https://lore.kernel.org/20261103224659.2865b9ff27d09994949edd78@linux-foundation.org Reviewed-by: Oscar Salvador Cc: James Houghton Cc: David Hildenbrand Cc: Huacai Chen --- mm/hugetlb_vmemmap.c | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) --- a/mm/hugetlb_vmemmap.c~mm-hugetlb_vmemmap-make-vmemmap-pte-conversion-folio-oriented +++ a/mm/hugetlb_vmemmap.c @@ -300,20 +300,26 @@ static inline int vmemmap_restore_range( } /** - * vmemmap_remap_split - split the vmemmap virtual address range [@start, @end) - * backing PMDs of the directmap into PTEs - * @start: start address of the vmemmap virtual address range that we want - * to remap. - * @end: end address of the vmemmap virtual address range that we want to - * remap. + * vmemmap_pteify_folio - convert the vmemmap backing of a folio to PTE mappings + * @folio: folio whose vmemmap range should be converted to PTE mappings. + * @flags: vmemmap remap control flags passed to vmemmap_remap_walk. + * + * Convert mappings covering @folio's vmemmap into PTE mappings. If TLB flushing + * is skipped, the caller must flush TLBs after all pteify operations are complete + * before remapping the folio's vmemmap pages. + * * Return: %0 on success, negative error code otherwise. */ -static int vmemmap_remap_split(unsigned long start, unsigned long end) +static int vmemmap_pteify_folio(const struct folio *folio, unsigned long flags) { struct vmemmap_remap_walk walk = { - .remap_pte = NULL, - .flags = VMEMMAP_DEFER_TLB_FLUSH, + .flags = flags, }; + unsigned long start = (unsigned long)folio_page(folio, 0); + unsigned long end = start + folio_vmemmap_size(folio); + + if (!vmemmap_optimizable_order(folio_order(folio))) + return -EOPNOTSUPP; return vmemmap_remap_range(start, end, &walk); } @@ -532,21 +538,13 @@ void hugetlb_vmemmap_optimize_folio(cons free_vmemmap_page_list(&vmemmap_pages); } -static int hugetlb_vmemmap_split_folio(const struct hstate *h, struct folio *folio) +static int hugetlb_vmemmap_pteify_folio(const struct hstate *h, struct folio *folio, + unsigned long flags) { - unsigned long vmemmap_start, vmemmap_end; - if (!vmemmap_should_optimize_folio(h, folio)) return 0; - vmemmap_start = (unsigned long)&folio->page; - vmemmap_end = vmemmap_start + hugetlb_vmemmap_size(h); - - /* - * Split PMDs on the vmemmap virtual address range [@vmemmap_start, - * @vmemmap_end] - */ - return vmemmap_remap_split(vmemmap_start, vmemmap_end); + return vmemmap_pteify_folio(folio, flags); } void hugetlb_vmemmap_optimize_folios(struct hstate *h, struct list_head *folio_list) @@ -571,7 +569,7 @@ void hugetlb_vmemmap_optimize_folios(str nr_to_optimize++; - ret = hugetlb_vmemmap_split_folio(h, folio); + ret = hugetlb_vmemmap_pteify_folio(h, folio, flags); /* * Splitting the PMD requires allocating a page, thus let's fail _ Patches currently in -mm which might be from muchun.song@linux.dev are mm-fix-missing-page-table-destructor-in-pagetable_free.patch riscv-mm-fix-hotplug-page-table-destructor-handling.patch riscv-mm-fix-missing-destructor-for-hotplug-pud-tables.patch arm64-mm-fix-destructor-for-unconstructed-hotplug-page-tables.patch mm-sparse-vmemmap-map-shared-vmemmap-tail-pages-as-read-only.patch powerpc-mm-map-shared-vmemmap-tail-pages-as-read-only.patch mm-hugetlb_vmemmap-remove-vmemmap_wrprotect_hvo.patch mm-hugetlb_vmemmap-remove-hugetlb_vmemmap_optimize_bootmem_folios.patch mm-generalize-kernel-pte-table-allocation.patch mm-generalize-pmd-page-table-allocation.patch mm-generalize-pud-page-table-allocation.patch mm-remove-pagetable_dtor_free.patch mm-remove-redundant-pagetable_dtor-calls.patch mm-hugetlb-fix-validation-of-unsupported-hugetlb-orders.patch