From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 43CD13F9278 for ; Wed, 8 Jul 2026 21:25:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783545934; cv=none; b=nA2VZEdbLJITfoqYxam+HWu9FYd6KGak4TXcWvDLlAPBxDwTEKSb49XVt9gvbSMPSkbH1rm0Znp4O8edH26o5a8HQD0j7a9uvJ+eOU/W0YKouiag0qwwjvTVTQM9U+BBUN34oBzkZ8JvrM4QHkzpcjTqf1jU75vP58U8PpxOdrM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783545934; c=relaxed/simple; bh=R3KTzAkehnP2WMoBq6rqGEwhyToWc7T44Dhe/swaZgI=; h=Date:To:From:Subject:Message-Id; b=IUwBDsW5ncLG5zr33C4IM5ACnHwQAk2YbhY4+OxHOc6ubSDJt++P7YdXJfJXxRtLkLHiRG7evcxd7thEwXH0kPwMnLHDzfMhzIM9kRBAF2QctXotXpGz6yguG2RaDtWA3LenqcmRfNCuyNp7q4db1+FDTDaw4Roq3fuGtKTrrkY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=oZ/8sPUE; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="oZ/8sPUE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 117EF1F000E9; Wed, 8 Jul 2026 21:25:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1783545933; bh=oB7Y9mO9zf+hmMxinj7gHFwdzcJLlTe8maoFAp3goWw=; h=Date:To:From:Subject; b=oZ/8sPUEcYU0t6h2f3hjtGV9U7dakIUoktVNaTdYLXCV7xX9psjftnoOUGtJsas56 BgkcQiOf+DUWDDegDrh1xmg02jn4tqQiln0Ez8x8Or5PrKaopgTCEm5V9lBve1gsnZ c/FttHHf9ssL4/eCwMpiq/+rwGERdOmCYiVbrDiI= Date: Wed, 08 Jul 2026 14:25:32 -0700 To: mm-commits@vger.kernel.org,ziy@nvidia.com,vbabka@kernel.org,svens@linux.ibm.com,surenb@google.com,rppt@kernel.org,peterz@infradead.org,osalvador@suse.de,muchun.song@linux.dev,mingo@redhat.com,mhocko@suse.com,luto@kernel.org,ljs@kernel.org,liam@infradead.org,jackmanb@google.com,hpa@zytor.com,hca@linux.ibm.com,hannes@cmpxchg.org,gor@linux.ibm.com,gerald.schaefer@linux.ibm.com,bp@alien8.de,borntraeger@linux.ibm.com,agordeev@linux.ibm.com,david@kernel.org,akpm@linux-foundation.org From: Andrew Morton Subject: + x86-mm-stop-marking-vmemmap-as-section_info.patch added to mm-new branch Message-Id: <20260708212533.117EF1F000E9@smtp.kernel.org> Precedence: bulk X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: The patch titled Subject: x86/mm: stop marking vmemmap as SECTION_INFO has been added to the -mm mm-new branch. Its filename is x86-mm-stop-marking-vmemmap-as-section_info.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/x86-mm-stop-marking-vmemmap-as-section_info.patch This patch will later appear in the mm-new branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Note, mm-new is a provisional staging ground for work-in-progress patches, and acceptance into mm-new is a notification for others take notice and to finish up reviews. Please do not hesitate to respond to review feedback and post updated versions to replace or incrementally fixup patches in mm-new. The mm-new branch of mm.git is not included in linux-next If a few days of testing in mm-new is successful, the patch will me moved into mm.git's mm-unstable branch, which is included in linux-next Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via various branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there most days ------------------------------------------------------ From: "David Hildenbrand (Arm)" Subject: x86/mm: stop marking vmemmap as SECTION_INFO Date: Wed, 08 Jul 2026 16:11:00 +0200 We added the whole bootmem registration machinery in commit 04753278769f ("memory hotplug: register section/node id to free"). The main use case was to remember to which memory section memmap pages belonged, so the memmap could be handled accordingly when freeing memory. However, all that machinery is not required anymore: a memory section can only get offlined if *all* pages can get offlined; and it can only get unplugged once offline. If some of these pages are unmovable memmap pages: bad luck, doesn't work. Offlining will fail. Further, a lot of this machinery was required for pre-vmemmap support. Now we only support the vmemmap with memory hotplug. So the whole machinery is useless today. Let's start by removing the last pieces by first stopping to mark vmemmap pages as SECTION_INFO. In free_vmemmap_pages(), we can now always just free the reserved pages directly. Link: https://lore.kernel.org/20260708-bootmem_info_part2-v1-5-156ce4986598@kernel.org Signed-off-by: David Hildenbrand (Arm) Cc: Alexander Gordeev Cc: Andy Lutomirski Cc: "Borislav Petkov (AMD)" Cc: Brendan Jackman Cc: Christian Borntraeger Cc: Gerald Schaefer Cc: Heiko Carstens Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Johannes Weiner Cc: Liam R. Howlett Cc: Lorenzo Stoakes Cc: Michal Hocko Cc: Mike Rapoport Cc: Muchun Song Cc: Oscar Salvador Cc: Peter Zijlstra Cc: Suren Baghdasaryan Cc: Sven Schnelle Cc: Vasily Gorbik Cc: Vlastimil Babka Cc: Zi Yan Signed-off-by: Andrew Morton --- arch/x86/mm/init_64.c | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) --- a/arch/x86/mm/init_64.c~x86-mm-stop-marking-vmemmap-as-section_info +++ a/arch/x86/mm/init_64.c @@ -1024,19 +1024,12 @@ static void __meminit free_vmemmap_pages { unsigned long nr_pages = 1u << order; - if (altmap) { + if (altmap) vmem_altmap_free(altmap, nr_pages); - } else if (PageReserved(page)) { - if (IS_ENABLED(CONFIG_HAVE_BOOTMEM_INFO_NODE) && - bootmem_type(page) == SECTION_INFO) { - while (nr_pages--) - put_page_bootmem(page++); - } else { - free_reserved_pages(page, order); - } - } else { + else if (PageReserved(page)) + free_reserved_pages(page, order); + else __free_pages(page, order); - } } static void __meminit free_pte_table(pte_t *pte_start, pmd_t *pmd) @@ -1593,12 +1586,8 @@ void register_page_bootmem_memmap(unsign p4d_t *p4d; pud_t *pud; pmd_t *pmd; - unsigned int nr_pmd_pages; - struct page *page; for (; addr < end; addr = next) { - pte_t *pte = NULL; - pgd = pgd_offset_k(addr); if (pgd_none(*pgd)) { next = (addr + PAGE_SIZE) & PAGE_MASK; @@ -1630,19 +1619,8 @@ void register_page_bootmem_memmap(unsign next = (addr + PAGE_SIZE) & PAGE_MASK; get_page_bootmem(section_nr, pmd_page(*pmd), MIX_SECTION_INFO); - - pte = pte_offset_kernel(pmd, addr); - if (pte_none(*pte)) - continue; - get_page_bootmem(section_nr, pte_page(*pte), - SECTION_INFO); } else { next = pmd_addr_end(addr, end); - nr_pmd_pages = (next - addr) >> PAGE_SHIFT; - page = pmd_page(*pmd); - while (nr_pmd_pages--) - get_page_bootmem(section_nr, page++, - SECTION_INFO); } } } _ Patches currently in -mm which might be from david@kernel.org are sparc-mm-drop-custom-pte_clear_not_present_full.patch mm-drop-pte_clear_not_present_full.patch mm-cleanup-clear_not_present_full_ptes-and-rename-to-clear_non_present_ptes.patch x86-mm-drop-order-parameter-from-free_pagetable.patch mm-provide-free_reserved_pages-removing-x86-variant.patch s390-mm-use-free_reserved_pages-in-vmem_free_pages.patch mm-bootmem_info-allow-calling-free_bootmem_page-on-pages-without-a-bootmem_type.patch x86-mm-stop-marking-vmemmap-as-section_info.patch x86-mm-stop-marking-page-tables-as-mix_section_info.patch x86-mm-remove-config_have_bootmem_info_node.patch mm-hugetlb_vmemmap-remove-bootmem_info-leftovers.patch mm-sparse-remove-bootmem_infoh-include.patch mm-bootmem_info-remove-config_have_bootmem_info_node.patch