From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5AF31606A31A for ; Mon, 26 Oct 2026 23:18:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=EDg6FAvy; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=c0btN4RF DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To: Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date:Subject: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Unsubscribe-Post:List-Owner; bh=ayLTO25mv8hsmSbKJI2pgTaDpBZ/HN5CAIFHS8ZziNk=; b=EDg6FAvyt6XrZBH9RSW4GU22wB M38mxCNBk6d+2W2BWEOuvwDbj9KSwa2CA64jLqVCkHmBiIridMjwWzjLItTzSkGRNhD+34QCQvne+ JdDfYHsaq2VY44x0O6EH2bxTYoFvBLp6MPyFOKvyFUxxok4IApoDw8qeEx6nRVHMHWiXvV3NytiNs buwP5br6HXbvXslmZ7wVtErkKDOpwUdHFDfpnglvDNObvs7YYvEWZOl83vu/rS0Jde0fKt8ptNMdq f7AtOxyw5KMMyQNWa0D+5AcQp+0lIjlcvj1yk9Ql6TaSGYBRV8/jcfdYBcZToDQ4zRSxSC0YVePar 8NCE273w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xLTx5-00000003Ow2-0N8l; Mon, 26 Oct 2026 23:18:03 +0000 Received: from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xLTx3-00000003Ovw-1uhg for kexec@lists.infradead.org; Mon, 26 Oct 2026 23:18:01 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 1666F600DA; Mon, 26 Oct 2026 23:18:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9A7691F01825; Mon, 26 Oct 2026 23:17:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1793056679; bh=ayLTO25mv8hsmSbKJI2pgTaDpBZ/HN5CAIFHS8ZziNk=; h=From:Subject:Date:To:Cc; b=c0btN4RFNd+JK9rkuoTETc7VF6swnFyYz0/L+oSt8CLgeMxb0G2BDek2IJa55YHgH jxflLIlpQ2WjGfXinmpmDcTPwOBNahVU3Fpt2SewilRmN+LtujcaoK9avQFbHhbqJn AToCFd3ZAWENyki274UuV7Hrzyj3mkZx+lZBHJAgQM7sMTU2YygJXf/22VO7LBayGo z1SiNI6qekyGCy9Qj3o0FBTBaCDVIkViGvV5TMESpQllEDQfyei0P9tTKvJQ0Me/gK wyAA7x7FGyfUCmcqmTS1uQLx7441jdglWG11IvyD9a9d/vtZG2IIN5UFht4h5Bdhmc BcrYLm+fhg8gw== From: "David Hildenbrand (Arm)" Subject: [PATCH 00/46] mm: various (urgent?) fixes Date: Tue, 27 Oct 2026 00:17:20 +0100 Message-Id: <20261027-fixes_core-v1-0-6f74bec9a5bb@kernel.org> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAIHf32oC/yXM3wpAMBQH4FfRubbapiSvIsnmjOMCnYOU9u6Gy 6/fnxsEmVCgzm5gPEloXRJMnoGf+mVERUMyWG1Lo61RgS6Uzq+Myg2hLKrQB20LSION8UtTv2l /y+Fm9Pv7ADE+TOnff24AAAA= X-Change-ID: 20261021-fixes_core-bdf638faf023 To: Andrew Morton , Johannes Weiner , Michal Hocko , Qi Zheng , Shakeel Butt , Lorenzo Stoakes , Kairui Song , Barry Song , Axel Rasmussen , Yuanchu Xie , Wei Xu , Baoquan He , Baolin Wang , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Kees Cook , Peter Zijlstra , Jann Horn , Pedro Falcato , Hugh Dickins , Pasha Tatashin , Pratyush Yadav , "Matthew Wilcox (Oracle)" , Jan Kara , Zi Yan , Lance Yang , Rik van Riel , Harry Yoo , Alistair Popple , Nico Pache , Ryan Roberts , Dev Jain , Usama Arif , Kiryl Shutsemau , Matthew Brost , John Hubbard , Peter Xu , Will Deacon , "Aneesh Kumar K.V" , Nick Piggin , Oscar Salvador , Minchan Kim , Muchun Song , Xu Xin , Chengming Zhou , Chris Li , Kemeng Shi , Nhat Pham , Youngjun Park , Gregory Price , Joshua Hahn , Rakie Kim , Ying Huang , Jason Gunthorpe Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, kexec@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, linux-cxl@vger.kernel.org, Josef Bacik , stable@vger.kernel.org, "David Hildenbrand (Arm)" , Chris Mason X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=6096; i=david@kernel.org; h=from:subject:message-id; bh=M759dBMTTuWvoyATaey2hLe92rKyKdXXWLH+ZXFHlx8=; b=owGbwMvMwCF2/OVpCdfQ3ZWMp9WSGLLu358o8+hoapKLufs0q+lpn12ZBLcv/3an4MwBsxfcD JVLS+V0OkpZGMQ4GGTFFFmCgu8bvHy5rrbajY8ZZg4rE8gQBi5OAZhI7S6Gf7r9S3UXX2XVt/qw JKtmldaMlmu2mzm5VXc2e62fdZhNyJrhn9WBe3v8/NPeHmqUd+L4lrf/+qQda2pP1TYyKv7KKbp 1jA8A X-Developer-Key: i=david@kernel.org; a=openpgp; fpr=1BD9CAAD735C4C3A460DFCCA4DDE10F700FF835A X-BeenThere: kexec@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "kexec" X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Another set of fixes from the current batch that focuses on all core-mm things that won't be sent out separately by others. I decided to bundle these together as they are all over the place. I have some hugetlb stuff in the works which is pretty horrible (code wise ;) ), that I will send out once ready. Plus some low-prio migrate_device oddities + two core-mm things that need more thought. This is the biggest set of patches coming from me, so don't be scared ;) Once more, some of the stuff is more urgent than others. No fixes are crazy big and most are easy to review. The majority are again fixes from Anthropic that I cleaned up or reworked. While doing that, I found a bunch of other issues and tried to fix them somewhat cleanly. I gave it at least some basic testing on x86-64; more testing will be highly appreciated. This is based on akpm/mm-stable. As with the shmem fixes, please prioritize review of these fixes, I want to get fixes for the issues in a timely manner upstream. Thanks to everyone helping out with moving the flood of fixes forward :) --- Chris Mason (11): mm/huge_memory: fix truncate racing with PMD zapping mm/huge_memory: fix zapping migration entries for device-private THPs mm/khugepaged: preserve dirty bits when collapsing PTE-mapped THPs mm/gup: fix clearing folios in memfd_pin_folios() mm/gup: fix out-of-bounds write for nr_pages == 0 in GUP-fast mm/mmu_notifier: set ->mm only after mmgrab() mm/memory: reject remote COW faults on PFN mappings mm: fix unkillable fault loop on MAP_DROPPABLE memory mm: fix deadlock of mremap() against UFFDIO_MOVE mm/ksm: check large swap-cache folios before mapping them mm/vma: call ->may_split() before a partial merge David Hildenbrand (Arm) (20): fork: take mmap_lock before copying mm_struct mm/memfd: check for real shmem inodes before accessing shmem state mm/truncate: look again if a folio left the mapping mm/filemap: finish fault cleanup before dropping the fault lock mm/rmap: handle device-exclusive entries in folio_referenced_one() mm/huge_memory: fix list corruption when deferred_split_scan() races with deferred_split_folio() mm/huge_memory: properly handle refcounted PUD mappings on fork mm/khugepaged: check if PTE table is empty in try_collapse_pte_mapped_thp() mm/gup: recheck the PUD under PTL in follow_pud_mask() mm/gup: check for overflow when converting nr_pages to bytes in GUP-fast mm/userfaultfd: write-lock the VMA before waking waiters when unregistering mm/userfaultfd: wake waiters when registration modes are removed mm/mremap: use pudp_huge_get_and_clear() when moving huge PUDs mm/mremap: recheck PUDs under the page table lock mm/madvise: fix data loss from MADV_FREE on a KSM page mm/ksm: reset the unstable trees of all nodes mm/ksm: fix use of a freed anon_vma at swap-in mm/huge_memory: split huge PUDs when adjusting VMA boundaries mm/vma: don't leak the charge for stack growth mm/memory-tiers: unregister empty tiers outside memory_tier_lock Josef Bacik (14): mm/mglru: don't use stack pointers when walking PUD and PMD tables mm/memfd: make f_pos accesses atomic mm/filemap: read mapping->a_ops->free_folio under i_lock mm/filemap: don't lose a folio lock wakeup to a signal mm/huge_memory: fix livelock on device private folio mm/khugepaged: always recheck the pmd in try_collapse_pte_mapped_thp() mm/khugepaged: fix PMD table lock leak in try_collapse_pte_mapped_thp() mm/userfaultfd: wake all waiters on unregister mm/mmu_gather: fix flushing ranges with 4 GiB or larger mm/mmu_notifier: finish non-blocking interval invalidation on error mm/mremap: fix moving PUD leaves mm/memory_hotplug: avoid races in pfn_to_online_page() with dying pgmap mm: fix unmap_mapping_range() beyond 4 GiB on 32-bit fs/proc/task_mmu: refuse addresses beyond 32 bits on 32bit Rik van Riel (1): mm/cma: don't release CMA pages still in use fs/proc/task_mmu.c | 6 ++ include/asm-generic/tlb.h | 3 +- include/linux/huge_mm.h | 5 +- include/linux/ksm.h | 6 +- include/linux/memremap.h | 6 ++ include/linux/mmu_notifier.h | 3 +- include/linux/shmem_fs.h | 6 ++ include/linux/userfaultfd_k.h | 2 - kernel/fork.c | 20 ++++-- mm/cma.c | 10 ++- mm/filemap.c | 88 ++++++++++++------------- mm/gup.c | 53 ++++++++++----- mm/huge_memory.c | 149 ++++++++++++++++++++++++++++++------------ mm/hugetlb.c | 14 +--- mm/internal.h | 28 ++++++++ mm/khugepaged.c | 77 +++++++++++----------- mm/ksm.c | 56 ++++++++++++---- mm/madvise.c | 9 +++ mm/memfd.c | 10 ++- mm/memfd_luo.c | 2 +- mm/memory-tiers.c | 29 ++++---- mm/memory.c | 30 ++++++--- mm/memory_hotplug.c | 13 ++-- mm/memremap.c | 13 ++++ mm/mmap.c | 8 +-- mm/mmu_notifier.c | 24 +++++-- mm/mremap.c | 103 +++++++++++++---------------- mm/nommu.c | 2 +- mm/rmap.c | 23 +++++-- mm/shmem.c | 5 ++ mm/swapfile.c | 3 +- mm/truncate.c | 17 ++++- mm/userfaultfd.c | 72 ++++++++++---------- mm/util.c | 13 ++++ mm/vma.c | 24 +++++-- mm/vmscan.c | 4 +- 36 files changed, 588 insertions(+), 348 deletions(-) --- base-commit: 183895979c441e52dbd651b388553b09eaa35cfa change-id: 20261021-fixes_core-bdf638faf023 -- Cheers, David