From nobody Sat Jul 25 19:29:10 2026 Received: from fhigh-b7-smtp.messagingengine.com (fhigh-b7-smtp.messagingengine.com [202.12.124.158]) (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 779A744683F; Tue, 14 Jul 2026 12:23:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.158 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784031841; cv=none; b=ScQYlQptVeLQ8by0iw+nlAqj0rkWSL4xa8jh7eMVn/9IsbtjjBjLxWjz0MdOdhxJr6VlKIZJZDUrmX4uibaN4ymI11GBqDGnD4DUE8NM9lshZcRwbbJWUeg7wD2juwx3LCDmM5ctj9gsTBBZw4p6HO0DmPYG21abD3kwLZKPDDU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784031841; c=relaxed/simple; bh=JAXHDQ65haSpPHSaLQiKhpO66Y7VCX6bh7SRJntNok4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=D17JTVhnxCQZP1HFh7GXARG2Kbv/q1NEoo3q+uvV3oKIaiwOAsE0hdiXO9JmBmfZwEjLcAaq6bRJayx2LQcM5btVAS2+OyBRPMdwpfGZ+2bLKS17FIN84FV53Z/qFmfRlLtKOCxcHMLHXiykNOVs8mtbD4lZs+K2EtU30uMt/Wc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=shutemov.name; spf=pass smtp.mailfrom=shutemov.name; dkim=pass (2048-bit key) header.d=shutemov.name header.i=@shutemov.name header.b=HfeikRSq; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=fREjrIAb; arc=none smtp.client-ip=202.12.124.158 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=shutemov.name Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=shutemov.name Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=shutemov.name header.i=@shutemov.name header.b="HfeikRSq"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="fREjrIAb" Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfhigh.stl.internal (Postfix) with ESMTP id 374987A00CF; Tue, 14 Jul 2026 08:23:51 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-05.internal (MEProxy); Tue, 14 Jul 2026 08:23:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov.name; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1784031831; x= 1784118231; bh=0g5oskdRgsUXvKNkDRa5faJ7aqOeb+0ELgNs1jz8A+Y=; b=H feikRSq/NAyfMt025iRCTPpadEaUfC2Icr1aPhqdRQ7KTT8SeDEptHSw1oAfQFVn KfffwSoGjaHKQFJG1SPNYfr8osmRwmuYtjtEuAj75ffoXnixJZm9Y7jnyah2LA25 0kh+DNPjtS5SgbNNMUHpSERBZmu9GIzS6wG3OL0RO54EGk9BgNbCskvBuNcvvkZE QkxCWbY4MoVtbHUA6dAnOTnr+kL8zJPX9/eKQApEH9K8yikF5bQZQIKFLcamHXO0 s9kzHbI46Qle2Bi/iPhtyIr5/WtAJU2imS0yT64M6beuwvYyroFDlomGh5yMFCWl tP9vR/qG27PWmf7Xv5CEA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1784031831; x=1784118231; bh=0 g5oskdRgsUXvKNkDRa5faJ7aqOeb+0ELgNs1jz8A+Y=; b=fREjrIAbdI17ntVKn MB8by3SxPUcW3qO+KdLZmEPeeGg/KmqRBtZY2cGUwwodsgX01r2DBhm3Vggp8Xp4 Nx/TuVnCQ3caFCL3j/F6RJHYYtFxL7gNELaTuw2lrIgxkyOycoI8y3aAqua9BMcV 5In2SikhPIDHqwBClDyojalCuSbrlTXSvRF/cQOJVZ+34LZZflIShhgrgIRZWN40 uV/R78R6/2BAjtvJozMVj81zg3PF0uvG2/qLmbzsnufNejX5UiHYYw9nuv0Zc2G0 mnQmTP1NC6roq364QNHm6zVcAPm1lOiryt2rN3IiJqtgBRakt6qj912NEVZqNP2r +nFBQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTFBvxovr0fjL2SDlhw64F6oFGvIraiDu6TVCnqgYaAZRHolensvaRSdeNznP8dyQu Coman3QLm+Yiv7vIU4gCaDoV3zjPLAT5xMyob2T/RAiyCRcX5nino2GdJfXAIhMAG9Vfbt 8DmmQq188Z2uGp2nkuYEczpQaZcUln/b+ViESl/1sRXWiXixSkmKZ86RELzVQX1c5DoIyj VYLQxCZGhSirPmfYkfg5Z9MFDCczGvA5NVGnQNjEY+/Dc2Z4MeErYRkfr5HJBXVY0/+gwS wMHbPHqeV/WaAxudjO5n+4mCCjxtqKMzuTd7bYDWa5SZhntkJG3EmwdwQQDclBgW6W8CDd Myk1BCEsjZDtocKPq6SFh76ysa5Z+9HMjeF/GuQroKl+BKIQFyK58Hi1iBuv4PrSsdBoed qUKBlvXQLkXzvgPziLsgfGTHmGmaAYjCQitkrzLMJEtaJKPypXwEldF3t7zIQu4Y1iJZYP 8JdHx+ZsougTMMNwOza4whUv7GUcGNzNVeniMjQ2nZ9bV7QR6oLgFbrAdUOB3q2DJGK6ko zjyFXvlBDUY3Dzjs61NkrSzXWUrHB86X9Z7AAS4GNjT7SNVwPl59/T1j+4ANijkQkYvFDr dHPg2tBOQ5IC/khlzTXlr1HzV0jz38hy2O+EhVl5dFQ+G65hq3VRfujqMbdQ X-ME-Proxy: Feedback-ID: ie3994620:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 14 Jul 2026 08:23:50 -0400 (EDT) From: Kiryl Shutsemau To: Andrew Morton , David Hildenbrand , Lorenzo Stoakes , Miaohe Lin , Naoya Horiguchi Cc: Zi Yan , Baolin Wang , "Liam R . Howlett" , Nico Pache , Ryan Roberts , Dev Jain , Barry Song , Lance Yang , Usama Arif , Hao Zhang , Hao Zhang , linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Kiryl Shutsemau (Meta)" , stable@vger.kernel.org Subject: [PATCH v2 1/5] mm/memory-failure: keep the folio, not the poisoned subpage, locked across split Date: Tue, 14 Jul 2026 13:23:40 +0100 Message-ID: <20260714122344.351895-2-kirill@shutemov.name> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260714122344.351895-1-kirill@shutemov.name> References: <20260714122344.351895-1-kirill@shutemov.name> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: "Kiryl Shutsemau (Meta)" try_to_split_thp_page() locked the poisoned page and passed it to split_huge_page_to_order(), which returns that very page locked to the caller. For a tail page that means __folio_split() runs with @lock_at pointing into the middle of the folio. __folio_split() dereferences the mapping after the split completes (shmem_uncharge(), i_mmap_unlock_read()). The only thing keeping the inode alive across that is the locked @lock_at folio: while it stays in the page cache, eviction cannot complete. But a tail @lock_at can lie beyond EOF -- e.g. part of a shmem THP that reaches past i_size while the file is being truncated. The split then drops it from the page cache yet still returns it locked, so the pin is gone and a racing final iput() can evict and RCU-free the inode while __folio_split() is still running: BUG: KASAN: slab-use-after-free in __up_read+0x634/0x790 i_mmap_unlock_read include/linux/fs.h:537 [inline] __folio_split+0x732/0x1640 mm/huge_memory.c:4100 try_to_split_thp_page+0xab/0x390 mm/memory-failure.c:1675 memory_failure+0x1394/0x26e0 mm/memory-failure.c:2470 Freed by task 4601: shmem_free_in_core_inode+0x54/0xb0 mm/shmem.c:5177 evict+0x57f/0xac0 fs/inode.c:870 Split the folio as a folio, via split_folio_to_order(), so the head is the anchor left locked. The head is piece 0, which the beyond-EOF drop loop never removes (it starts at folio_next(folio)), so the split always leaves it in the page cache and the inode stays pinned for the whole of __folio_split(). memory_failure() and soft offline re-lock the poisoned subpage's folio themselves after the split, so they do not depend on it being returned locked. Reported-by: Hao Zhang Closes: https://lore.kernel.org/linux-mm/20260710071344.GA106129@zh-pc Fixes: baa355fd3314 ("thp: file pages support for split_huge_page()") Cc: Signed-off-by: Kiryl Shutsemau (Meta) Acked-by: David Hildenbrand (Arm) Reviewed-by: Baolin Wang Reviewed-by: Zi Yan --- mm/memory-failure.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 51508a55c405..68d42cbed458 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1657,11 +1657,18 @@ static int identify_page_state(unsigned long pfn, s= truct page *p, static int try_to_split_thp_page(struct page *page, unsigned int new_order, bool release) { + struct folio *folio =3D page_folio(page); int ret; =20 - lock_page(page); - ret =3D split_huge_page_to_order(page, new_order); - unlock_page(page); + /* + * Lock and split at the head, not the poisoned subpage: __folio_split() + * keeps the anchor folio locked and needs it to stay in the page cache + * to pin the inode. A tail beyond EOF would be dropped yet returned + * locked, losing that pin. The caller re-locks @page afterwards. + */ + folio_lock(folio); + ret =3D split_folio_to_order(folio, new_order); + folio_unlock(folio); =20 if (ret && release) put_page(page); --=20 2.54.0 From nobody Sat Jul 25 19:29:10 2026 Received: from fhigh-b7-smtp.messagingengine.com (fhigh-b7-smtp.messagingengine.com [202.12.124.158]) (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 8809C44682A; Tue, 14 Jul 2026 12:23:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.158 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784031844; cv=none; b=IXRaAK08uk//gjdM93KLBhc65a6re7GEhFrtLNIk6jnUFIIgnKKs3imVfqVMLXbKkfAxc+90RCkti9IkD3gG2sWqnq6aTVQcRGZtjvWR8Az1AvoJ6hxFRcvSHb02qjaEWa4B4T7dtD8ttACYPMVqWPLr67fm4zl+Ma1N7w5Yt9I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784031844; c=relaxed/simple; bh=jQNVO4RRwQ525O93hAsBPU5SzGEuk75wV+ZKmx7uvqU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CpUn0yBhnbFQITq5mUB+TyI7X9PxVjaKquwCPX74qGVeFe0pgj5PQFgbqp8iqDX897aRZkveglHQuqhjoJruFD1R88f6svNF4AYE6w8vbGhEsxgZu5EGK0g1RR9VnprSZz5fxT7W8TXHmJ02SUJVvZLqAM32Fy8SgK/U/ac/RXo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=shutemov.name; spf=pass smtp.mailfrom=shutemov.name; dkim=pass (2048-bit key) header.d=shutemov.name header.i=@shutemov.name header.b=WLGNLuJF; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=dxic3/Ka; arc=none smtp.client-ip=202.12.124.158 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=shutemov.name Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=shutemov.name Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=shutemov.name header.i=@shutemov.name header.b="WLGNLuJF"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="dxic3/Ka" Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfhigh.stl.internal (Postfix) with ESMTP id B7E287A00D9; Tue, 14 Jul 2026 08:23:53 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Tue, 14 Jul 2026 08:23:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov.name; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1784031833; x= 1784118233; bh=/0a1QUYMOPMY+SvL6khttYjCLI43JqaOiKufnepwcnw=; b=W LGNLuJFxBWrSHckB5wRVqupAOxNLygiRQyPEsUw7uASygYWzCxbrMGxNB2NIgoQ9 EHffatN/GgCS7/ABt0RfMD5rKbJMY3nCMU3FTRYFoXEqyfIsPWdGA7V8XxgkgySR flZUbd3L3LTWZ7Q6DS+zopB+k2IVjaERRMCTOWNh/Y7nP487sxWxujjT7udFOVLB It2tOnYqj6fEgvYVIYpGMwbJepTDPC/346vIxQiEIm4pOrqkVPJ1vPOvwy/gNEtY toQLi/ulIsUq/vW5zLFryE2/Fr8obt8NEeXY0T/p9kTg/hx0IOhs9Y/+PoSK47wG v0Blh7m+6exfc+bqHFY8g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1784031833; x=1784118233; bh=/ 0a1QUYMOPMY+SvL6khttYjCLI43JqaOiKufnepwcnw=; b=dxic3/KaZf89qck97 vfe2mTSSOFkWLBxDBwepWT1gEWeXbf2QX9iW4Bmzfonw8WnKpVrHa/YuL0iy/hTe cyREDf73F2o4ehWyDa9wSt/XNdGD3uA8Na3/vyapWSKTnRFMNch1rHj4jjXpRdGs SQTkoClZNum0JjnryUM6vra9k2k10VWI2b3uM8Wu/bZP0yKfPXyXpqu4n8p8jTVt Br4QeRE1htq65UV4+DaGHbBXhiVLd4EWlbGNv39HLszzf+cjADAjdWIB9NwVn4bs xlNujrBpYB1AJxQFibUKmevJBAJMAkjiQkzEDhHmsx7DJR6nxuIxl82gPS7jYvHQ 0/g8w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTE/UbLJkgjt0BoqHglwrJX1f5PHEA/FB0nSUDVtYKpndNAtdUl6JHnSUpXWMgfs4c d4J6LwvZCUX0a5T+QyiumtaKrodT7U+OJWhjSGjWu2F5DfddgHzIfut/BYthc7Sto1/3uk EHEI9Uu/OGSx6QViQOKP9KqikD2m/IBo47muElgTZEunn3coMc/3CzhGZk75H75+Vz2euG I8nkEmlGh0wryQWBMqDENy1O90ym5jZd3bfa9OkWP8p+lMnB48rVCs57F+52UpkmpKSDTQ pvWo96Nduo4s64x50svctFa77x9730BnaPHuEEzPQXyZFSJzjFCAKNnirj3a4e+5JuRctf 3AjwX4rDrPBcraK/o3UwdKh0iaxSX+j0q99V36cWJJo35qVybt7yo+jUA//DL74jZfDjav UwpHaX/LCOA8zLyCvjnSWcAJJdWonIZKQH5EkfB86gIoxmJbdDA/+gkzlAz8tI6pHf3a4Q hY2OEtBhBzJ8T2pcXDcts6nWcgon4DmboC3fGXnInCtwRiZ5EkfXNB6ZNhCRLIAIk6nzUy qDkB38vSo+lJme+ZkJwsNqpUM/STROBDHByw9QDBKHESUSqRTs4phsjtAFbf+MiBfVmkDn dJIe+pmHbjx71Zo+FTWJjNbMq9SQZvTIoOvz1lSpZenE7wQBJ8EqCdZmaqSw X-ME-Proxy: Feedback-ID: ie3994620:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 14 Jul 2026 08:23:52 -0400 (EDT) From: Kiryl Shutsemau To: Andrew Morton , David Hildenbrand , Lorenzo Stoakes , Miaohe Lin , Naoya Horiguchi Cc: Zi Yan , Baolin Wang , "Liam R . Howlett" , Nico Pache , Ryan Roberts , Dev Jain , Barry Song , Lance Yang , Usama Arif , Hao Zhang , Hao Zhang , linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Kiryl Shutsemau (Meta)" , stable@vger.kernel.org Subject: [PATCH v2 2/5] mm/huge_memory: refuse to split a file folio when the anchor is beyond EOF Date: Tue, 14 Jul 2026 13:23:41 +0100 Message-ID: <20260714122344.351895-3-kirill@shutemov.name> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260714122344.351895-1-kirill@shutemov.name> References: <20260714122344.351895-1-kirill@shutemov.name> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: "Kiryl Shutsemau (Meta)" __folio_split() dereferences the mapping after the split completes: shmem_uncharge(mapping->host) for folios dropped beyond EOF and i_mmap_unlock_read(mapping) on the way out. Nothing holds an inode reference for that duration; the split relies on the caller's locked @lock_at folio, while it is locked and present in the page cache, to keep the inode alive through eviction's truncate_inode_pages_final(). If @lock_at lies beyond EOF, __folio_freeze_and_split_unmapped() removes it from the page cache while keeping it locked for the caller. That drops the pin and lets a concurrent final iput() evict and free the inode under the still-running split. On the anon side __folio_split() already pins its anchor explicitly (folio_get_anon_vma()); the file side's anchor was always the locked in-cache folio, just never enforced. The only in-tree caller that passed a beyond-EOF @lock_at was memory_failure(), fixed in the previous patch to anchor on the head. Make the requirement explicit so it cannot be reintroduced: refuse the split with -EBUSY when @lock_at is at or beyond the sampled EOF. Such a folio is racing truncation, so there is nothing useful to split; -EBUSY is already handled by every caller. The check uses the same @end sampled under the folio lock that the drop loop uses, so it does not race the trimming it guards against. Fixes: baa355fd3314 ("thp: file pages support for split_huge_page()") Cc: Signed-off-by: Kiryl Shutsemau (Meta) --- mm/huge_memory.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 2bccb0a53a0a..0e3ca7178d8c 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -4065,6 +4065,20 @@ static int __folio_split(struct folio *folio, unsign= ed int new_order, end =3D DIV_ROUND_UP(i_size_read(mapping->host), PAGE_SIZE); if (shmem_mapping(mapping)) end =3D shmem_fallocend(mapping->host, end); + + /* + * @lock_at is returned locked to the caller, and while it is + * locked and present in the page cache it is what keeps the + * inode alive: the mapping is still dereferenced after the split + * (shmem_uncharge(), i_mmap_unlock_read()). If it lies beyond + * EOF the split would drop it from the page cache while handing + * it back locked, removing that pin. Such a folio is racing + * truncation and there is nothing useful to split; bail out. + */ + if (folio->index + folio_page_idx(folio, lock_at) >=3D end) { + ret =3D -EBUSY; + goto out_unlock; + } } =20 /* --=20 2.54.0 From nobody Sat Jul 25 19:29:10 2026 Received: from fout-b1-smtp.messagingengine.com (fout-b1-smtp.messagingengine.com [202.12.124.144]) (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 3DFAA445AF1 for ; Tue, 14 Jul 2026 12:24:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.144 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784031845; cv=none; b=awNog5Fijy4yL3231paAhZOTzcEs0udCXDY75qWSXBUpxuyq1jKIkS1EpAjUOykUcoX07Zvz61cm5rM0414+Sep3xzEDVAJ6SWFWR03iU3xDG55Vso6V95X8dweA5SZ1ejnG5GLSiixMxFaUo6pYAgQIJkoBNg69fZbOj10bXWA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784031845; c=relaxed/simple; bh=aoVKZR1A2MLbFPmQoR5hYwuYmHkNs4dwDm1Dti4NFNU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HgzY23N53NW+lzQOu7Pr2vSekscDIT4dz2y0jLNRRHJSUenUYw3KN1Vbj70c32mwblzXd9l/xu+grdK1ASlNXliaduefge8WZAmEH7Ftf9yRwEc6jQhisj68QYUq4amFTETi7+FgVDtBFyNiWnM5tCRyGLblrlJJmBAuZzwv1Sg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=shutemov.name; spf=pass smtp.mailfrom=shutemov.name; dkim=pass (2048-bit key) header.d=shutemov.name header.i=@shutemov.name header.b=P8FbB0sc; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=KBK7oTEe; arc=none smtp.client-ip=202.12.124.144 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=shutemov.name Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=shutemov.name Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=shutemov.name header.i=@shutemov.name header.b="P8FbB0sc"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="KBK7oTEe" Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfout.stl.internal (Postfix) with ESMTP id 091C61D000B2; Tue, 14 Jul 2026 08:23:56 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Tue, 14 Jul 2026 08:23:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov.name; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1784031835; x= 1784118235; bh=lZGgqHfnxnxp8vcpU2HELeh1jY2/4EmvBfBpJVtKKVY=; b=P 8FbB0scPV8Z/Xe2YgMOs1y85yLrjyeZj6HswC+a1GIiPAhC42XZki2gZUxGR8DKX XFYdYu8QVgQuQJU1UiltchmkJxrNxruDmUpJUKNFZIQ9uG1kd/KzNhpkVqjgmoMW hGemhn62+b7gOXfm7FFzAP4vGMweZasUIQGg+63/RQvbgKzUd7hf6T9xWe5vf7vh s/ossOmoP2rwkO+/gjUBolqAYNC1goj8vFrThteT0qlS/jRGw3qlAUT66+uwIP9N t/2XEUtUwmyfLqX1NxuIba63MbW+zkHsAnow/nj+ukSF3D+9qN06x2I8vcrqJD7/ a27qOawyOn0RULKB3jBXw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1784031835; x=1784118235; bh=l ZGgqHfnxnxp8vcpU2HELeh1jY2/4EmvBfBpJVtKKVY=; b=KBK7oTEe8WUxc7JSJ c7KydpEoPUdbYu5ZTohjcku7gG8XaUGIOjMyROLogltpRrqVBSV1HztDYRpRtefq olCIs0sJ1RB/CN06kPSlFRXz7sWRmj73PaNFKUEcyLDi4tdA7LtKEiP+P0ClVFAr mbph0sImpZ87j40Ffy4vUXGBwNws0SKbHfMQ6qisGpQHklBnHG64HsJC/587XjLs 5ENHjuHgLAI8JVKcUOyo0OECxwQdsZ9c5Kybq880jj9adj+qcf/rXjk3j189dKvc UlyXhZBy11vohZP7fhmuxAColoDlrIT1MRXtX51HHSZWOoqDfDJo6lGs6t1M3MDt wFjJA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTFMICEClsb7Ov+fedgnp0pMqXO1FfBD0xvZZ/V6P433GtqExWJyu3GARbG0/r6UJr Vf8nlq0lv2eCRUGCgAvBzEv5gE9KqzX1y7uFCtcvkB+wk1F+H1pzvrmeq3ImlGsBni87oI /YJqxi0JFt3vGMbm+u361lX7c8CBMgJ1ybWe2KN/ei2Wm5Kh7AGZP5ET8MkAeVDldf1ZFf llAd1ziCU3FyBV8QCjXQzkJyi8QMxgwqv8RzxuHH/6PIE1w8t3MzGVjuBE4OT1E4WpjGBL sxvt+r+K97QKtnJqN3sNNbSNEnM+m+h8tV+Tsxrhb/vhMT9muSuzm8yJyy59nX9YgO4xkL KklZs9i6gz8ILQFsijAUucD6l0KWgGv0Jo81muEkLxb5A//0xw/2MLGWYzDR1xs/2sB7j8 P8Wd0R6Dh33OXZ8Nc2kJx338Hub42OlRI/eNLqs2qQdVy36KRExL280V6laleHROH28RWm OlbWaFo+x0KgdOu5oga78Z1qOoXDatcJiGit8re6dqijGepNN4a3TiTP0EY8P2VX+9PNyo ZsLoBEp+Awo/VAejd1pZOskPCzSZfoZTvo6idWQLuKtxeNjn6mQQw9DKNXejNzNZ3+VQ+H HFtRvURgQf1XmKM2MDklGpZPDuTtb9MdZULKMifM2c3nYam/Bx8Bvm0gbngA X-ME-Proxy: Feedback-ID: ie3994620:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 14 Jul 2026 08:23:55 -0400 (EDT) From: Kiryl Shutsemau To: Andrew Morton , David Hildenbrand , Lorenzo Stoakes , Miaohe Lin , Naoya Horiguchi Cc: Zi Yan , Baolin Wang , "Liam R . Howlett" , Nico Pache , Ryan Roberts , Dev Jain , Barry Song , Lance Yang , Usama Arif , Hao Zhang , Hao Zhang , linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Kiryl Shutsemau (Meta)" Subject: [PATCH v2 3/5] mm/huge_memory: remove unused split_huge_page_to_order() Date: Tue, 14 Jul 2026 13:23:42 +0100 Message-ID: <20260714122344.351895-4-kirill@shutemov.name> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260714122344.351895-1-kirill@shutemov.name> References: <20260714122344.351895-1-kirill@shutemov.name> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: "Kiryl Shutsemau (Meta)" The last caller, memory_failure()'s try_to_split_thp_page(), was converted to the folio-native split_folio_to_order() in the previous change. split_huge_page_to_order() now has no users; the folio helpers (split_folio_to_order(), split_folio_to_list_to_order()) cover uniform splits and split_huge_page() covers the order-0 case. Remove it. No functional change. Signed-off-by: Kiryl Shutsemau (Meta) --- include/linux/huge_mm.h | 9 --------- 1 file changed, 9 deletions(-) diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index ad20f7f8c179..77483c613f84 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h @@ -414,10 +414,6 @@ static inline int split_huge_page_to_list_to_order(str= uct page *page, struct lis { return __split_huge_page_to_list_to_order(page, list, new_order); } -static inline int split_huge_page_to_order(struct page *page, unsigned int= new_order) -{ - return split_huge_page_to_list_to_order(page, NULL, new_order); -} =20 static inline int split_huge_page(struct page *page) { @@ -633,11 +629,6 @@ split_huge_page_to_list_to_order(struct page *page, st= ruct list_head *list, VM_WARN_ON_ONCE_PAGE(1, page); return -EINVAL; } -static inline int split_huge_page_to_order(struct page *page, unsigned int= new_order) -{ - VM_WARN_ON_ONCE_PAGE(1, page); - return -EINVAL; -} static inline int split_huge_page(struct page *page) { VM_WARN_ON_ONCE_PAGE(1, page); --=20 2.54.0 From nobody Sat Jul 25 19:29:10 2026 Received: from fhigh-b7-smtp.messagingengine.com (fhigh-b7-smtp.messagingengine.com [202.12.124.158]) (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 7BBFA4483AD for ; Tue, 14 Jul 2026 12:24:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.158 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784031856; cv=none; b=AcAWIFpuxuJ/docD5MpEplMaQ8a+xNxS+Osxaf5zHaTvnHO73GgN22EDss2W6qGMqhjdjiIsOPCd8xWYBpD1oqGdN6YUv5K4ALGUnkGmGyqVaSOxq+iPt2kjLlh394rGfFadM0hoAYvjsLyPRj9t+Ct8ndEcvNjoL8quK6WmWjs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784031856; c=relaxed/simple; bh=j7Boox2eYAExhdXidxpas3lnXwnQYbhnlutuo80MW5U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lmG2NgFsBx5CYZ22ENlPnuMpjLJF7ef7N7Ak6iesYnA5/adQGh8wv9gxpPfYGT4Bb49PgV9d4VOs6KrMv7xbNvAZAp+LW+1sRUIV6p7hgffTBkbPDg5DaZ6TW9k1LuYvlkbAMsFsZf7pPNe/n4ChpKhuDQrdxmLTqcyZ+3GEf+M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=shutemov.name; spf=pass smtp.mailfrom=shutemov.name; dkim=pass (2048-bit key) header.d=shutemov.name header.i=@shutemov.name header.b=hdlnm5p2; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=A8JnJvmL; arc=none smtp.client-ip=202.12.124.158 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=shutemov.name Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=shutemov.name Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=shutemov.name header.i=@shutemov.name header.b="hdlnm5p2"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="A8JnJvmL" Received: from phl-compute-07.internal (phl-compute-07.internal [10.202.2.47]) by mailfhigh.stl.internal (Postfix) with ESMTP id 865307A00CB; Tue, 14 Jul 2026 08:23:58 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-07.internal (MEProxy); Tue, 14 Jul 2026 08:23:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov.name; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1784031838; x= 1784118238; bh=RlyQ/1sYUn+kGDyqGS8qP1M9HTBHhDiPAEwXerbSews=; b=h dlnm5p2GCBYXBj2MUTrjwn+EJl5ONzDA5mrRG8cV8vtEGMkFMRWfybDfMHuWtdZV 6CF7+Rp/ydiQH6P2gKLoxTkrwOJZ3Q6y4Nhu0NjCgXrFlQ1r2oVa8tGpK/lLO0xa yydeId7vsj2wCzYBDz8oNnxa/zL7UjDPWheKmnNlAauMgb0VOVw49HLpgCfWY3IB 2/GExERlAD5RVprYpbq4DAbroN8nFKTCMWowUKrn6DyKNEz3GxgrEqfCrAx/zCop In2eT8Hsr0Tm+7tvqEjbHmbcG7QWUc9iGLka90CTVt9CEIE4ihKhNR0W3H0gM0vA VVAicLmAmDi/WS1NblrWg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1784031838; x=1784118238; bh=R lyQ/1sYUn+kGDyqGS8qP1M9HTBHhDiPAEwXerbSews=; b=A8JnJvmL8Ik+1yiXB cvM9XiJL+MMze96eFyFb6rzhQSqE8+5QvLB4SOzzE8nexiOuFreMHORoFmUWfUbk AekZa+RwPD0NJT/v03l3ypGr/a6yrEm8gymfAKF4/QRZ9cp4UQb7+TnbjTBLsrB7 lagM2TjXuOmrqajRR9vTlwn5NBq0cDdVuoEN3dHJ/+EHvuFSWQOaB2Opj9MOXs/7 tOjKRsLq7EvSozv9lij7RUX7/GVP8L9G/H3E+FHc00QqB3tn0uou0PqoHDi60aYv K0/qnC8Ik0uq3DD4huFJTk2CHWssfRb8aQvioO7SsdeThojiVNqiyLHbtVOcmR4L jOUbw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTFMICEClsb7Ov+fedgnp0pMqXO1FfBD0xvZZ/V6P433GtqExWJyu3GARbG0/r6UJr Vf8nlq0lv2eCRUGCgAvBzEv5gE9KqzX1y7uFCtcvkB+wk1F+H1pzvrmeq3ImlGsBni87oI /YJqxi0JFt3vGMbm+u361lX7c8CBMgJ1ybWe2KN/ei2Wm5Kh7AGZP5ET8MkAeVDldf1ZFf llAd1ziCU3FyBV8QCjXQzkJyi8QMxgwqv8RzxuHH/6PIE1w8t3MzGVjuBE4OT1E4WpjGBL sxvt+r+K97QKtnJqN3sNNbSNEnM+m+h8tV+Tsxrhb/vhMT9muSuzm8yJyy59nX9YgO4xor 30JfFSD2t1CmF9NejP09k1EANtNrmkL5jIxnKNv9Su/ZvmS0oYeNEf4Er6eS6d1YV/xp/P osI62xrqjlkfFMMGca338uhwOb0jZzvqJoSbkg1z4E0M/pUvMzD7RZpEJxKS1GulDvAQFG NQImhYk2+kjR0uZy2CMdRPLufHd5rh4nOTjPrRaG9L8nhngV+OSGAXMEXTWcHGj7PkYasC 8kHbPAFSyTwt+dQrLruETvdDYFt8zz6XdkTGEhW3i73z49yGUH/HwDi5LiIWTdbteTfp03 NT06J+5zqw+wYRdBcyFuRiYGKCCGDtqz6dXz/loeY8f0kZgdRW5UHQOk8ihw X-ME-Proxy: Feedback-ID: ie3994620:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 14 Jul 2026 08:23:57 -0400 (EDT) From: Kiryl Shutsemau To: Andrew Morton , David Hildenbrand , Lorenzo Stoakes , Miaohe Lin , Naoya Horiguchi Cc: Zi Yan , Baolin Wang , "Liam R . Howlett" , Nico Pache , Ryan Roberts , Dev Jain , Barry Song , Lance Yang , Usama Arif , Hao Zhang , Hao Zhang , linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Kiryl Shutsemau (Meta)" Subject: [PATCH v2 4/5] mm/huge_memory: remove unused can_split_folio() Date: Tue, 14 Jul 2026 13:23:43 +0100 Message-ID: <20260714122344.351895-5-kirill@shutemov.name> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260714122344.351895-1-kirill@shutemov.name> References: <20260714122344.351895-1-kirill@shutemov.name> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: "Kiryl Shutsemau (Meta)" can_split_folio() has no callers and no definition under CONFIG_TRANSPARENT_HUGEPAGE; only the !THP stub remains, left behind by an earlier cleanup. Remove it. No functional change. Signed-off-by: Kiryl Shutsemau (Meta) --- include/linux/huge_mm.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index 77483c613f84..a38db095b5bd 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h @@ -617,11 +617,6 @@ thp_get_unmapped_area_vmflags(struct file *filp, unsig= ned long addr, return 0; } =20 -static inline bool -can_split_folio(struct folio *folio, int caller_pins, int *pextra_pins) -{ - return false; -} static inline int split_huge_page_to_list_to_order(struct page *page, struct list_head *list, unsigned int new_order) --=20 2.54.0 From nobody Sat Jul 25 19:29:10 2026 Received: from fhigh-b7-smtp.messagingengine.com (fhigh-b7-smtp.messagingengine.com [202.12.124.158]) (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 7EB404483B1 for ; Tue, 14 Jul 2026 12:24:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.158 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784031854; cv=none; b=fsT9vrPN+5otfYflgOxKksNaitLL/IvkH0uVgUn8De0KawPxqynvwQz3l5ydA4aAj+rXbgzvAValC+XUx6IyH3pp/pp7UkGcZKpD+BOpqpn2NO3Ym3bhbTNTJ+VBukE/vw4S4UbtyGccruvnT9Q+VQKAE+c2dJBXavh6otyr71c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784031854; c=relaxed/simple; bh=DQdUkUaZehCFr2HwXFxKIIVw4c+BQaqenxUjS9UFdgk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IIR7nW08l1hWe5Sek+SfF7WZw6bI1KhAXrpeo7fjgfQkAsLE0sBXW17ofzsPpr49bmir7Er0ICWpppLwK4EW5WARk/kSFTscuaND8WMgHEsUd89iTV4Xc4iMyzNQwe5KXDcUcRq4fc4pIGZF0nS3N27C4kV8uVBMzRm1ht/xh2U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=shutemov.name; spf=pass smtp.mailfrom=shutemov.name; dkim=pass (2048-bit key) header.d=shutemov.name header.i=@shutemov.name header.b=g9YR9zBo; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=fdytN4SX; arc=none smtp.client-ip=202.12.124.158 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=shutemov.name Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=shutemov.name Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=shutemov.name header.i=@shutemov.name header.b="g9YR9zBo"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="fdytN4SX" Received: from phl-compute-12.internal (phl-compute-12.internal [10.202.2.52]) by mailfhigh.stl.internal (Postfix) with ESMTP id 225607A00D1; Tue, 14 Jul 2026 08:24:01 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-12.internal (MEProxy); Tue, 14 Jul 2026 08:24:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov.name; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1784031840; x= 1784118240; bh=C6UpTAWsFeahWyNfDB0LFkzQxhy7tot31XOnv4oxF9c=; b=g 9YR9zBoUn5vEZwn7jAqvVGjWyvZBcAsJ2siLRMaqe8pZR+MYZf9Kppdf89eY/S7B r3geHXxegLzSGDnwRvXfbsHCC+N+3wF/4zloSVmpbm2sgFoTuwdmrY2HXyk0EM7j SWo7ID+WfNzovr1xOxfPbsKLgnQgf6XimZXb6ux1/xO0m3ZloaMPRZnXnmCN6IUi e7BET5E/7J1YAMkFb3ot8FOjByO6P/DZPdCivL3WhmW5pbtAFgMIu/GB6h0hOk8q d+zNvrNCz3VqSLy6qEZT1MyAKOkHjrh+j9MmQW+gKR1DMVAu1YZR8Y76h1mPbyf/ L45BpiXG2fXteIKlyZldA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1784031840; x=1784118240; bh=C 6UpTAWsFeahWyNfDB0LFkzQxhy7tot31XOnv4oxF9c=; b=fdytN4SXJWjR1ZNB0 aaWnKvfT0TtVekmQic/lRZSRr/j+4AUzjkBrFmP74MCK+BunoL5cIj4/uru0oFMr cGYsFIIOaBJl413nAoEHy3vu2ZNY/r2thAYS7qaP2icbq2fWDsnsQF/TlqZMdKGa QPvNq20GJND4zB3cyWPOJV9CdsAwcYkE+TKApbWkxDoGeYiVE9uFBcjotiKDFiDi hWXDrNllz6ZK7t0dYPej6ksybAEwC/ZxfX6irmtiCk/iKsVYb7O1ovp5rfi1mykL KwQKMFKPxJy4PoWM4OQ76Qirdd9u6NgXgmxjl9c1YkNyMILPDEYtS8REB/CCJXuF 9wyNQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTFMICEClsb7Ov+fedgnp0pMqXO1FfBD0xvZZ/V6P433GtqExWJyu3GARbG0/r6UJr Vf8nlq0lv2eCRUGCgAvBzEv5gE9KqzX1y7uFCtcvkB+wk1F+H1pzvrmeq3ImlGsBni87oI /YJqxi0JFt3vGMbm+u361lX7c8CBMgJ1ybWe2KN/ei2Wm5Kh7AGZP5ET8MkAeVDldf1ZFf llAd1ziCU3FyBV8QCjXQzkJyi8QMxgwqv8RzxuHH/6PIE1w8t3MzGVjuBE4OT1E4WpjGBL sxvt+r+K97QKtnJqN3sNNbSNEnM+m+h8tV+Tsxrhb/vhMT9muSuzm8yJyy59nX9YgO4xIq 8JvdPz/A34dtAVWALsPwuK97tFYQYhFp31kZEmmjGJuUeXCBI0m5Nch6OUvWOayLWsgRLa RlK4JV4IxXE0M156J79JjPDgKLEZ8XL/Pnj4F9uusy/yXm9x+b0yKaHyTAM8rOdTTwEM2i t1mM9c3kiVCYVnmjx5mAMa7GIMwyolnyOc0kyYLdz/E4TC15j2XNgwPPtLe9Xwsyh1l+// wx9INC2DX85BZSsUGZ3PBYm5BExagwj+/YGLPfSGOx9n3dbq7VcZfCRu4+t4FnCZFVZ8wc fN0KoejQLe9WN7WKDzoGXJNXotrnj7V9ZhYnPY2ZLuhavKHQasNMJPZSHg0A X-ME-Proxy: Feedback-ID: ie3994620:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 14 Jul 2026 08:24:00 -0400 (EDT) From: Kiryl Shutsemau To: Andrew Morton , David Hildenbrand , Lorenzo Stoakes , Miaohe Lin , Naoya Horiguchi Cc: Zi Yan , Baolin Wang , "Liam R . Howlett" , Nico Pache , Ryan Roberts , Dev Jain , Barry Song , Lance Yang , Usama Arif , Hao Zhang , Hao Zhang , linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Kiryl Shutsemau (Meta)" Subject: [PATCH v2 5/5] mm/huge_memory: fold split_folio_to_list_to_order() into split_folio_to_order() Date: Tue, 14 Jul 2026 13:23:44 +0100 Message-ID: <20260714122344.351895-6-kirill@shutemov.name> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260714122344.351895-1-kirill@shutemov.name> References: <20260714122344.351895-1-kirill@shutemov.name> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: "Kiryl Shutsemau (Meta)" split_folio_to_list_to_order() had no direct callers; its only user was split_folio_to_order(), which always passed a NULL list. Fold it into split_folio_to_order() and call split_huge_page_to_list_to_order() directly. No functional change. Signed-off-by: Kiryl Shutsemau (Meta) --- include/linux/huge_mm.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index a38db095b5bd..8a10a886e62a 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h @@ -783,15 +783,9 @@ static inline bool is_pmd_order(unsigned int order) return order =3D=3D HPAGE_PMD_ORDER; } =20 -static inline int split_folio_to_list_to_order(struct folio *folio, - struct list_head *list, int new_order) -{ - return split_huge_page_to_list_to_order(&folio->page, list, new_order); -} - static inline int split_folio_to_order(struct folio *folio, int new_order) { - return split_folio_to_list_to_order(folio, NULL, new_order); + return split_huge_page_to_list_to_order(&folio->page, NULL, new_order); } =20 /** --=20 2.54.0