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=1796381614; b=m8jLXehEq9eonEmvAGtDh4WOyq9/hrVH202wPKwtw2YDVGhQwDAtZiuWBIqLjEfjcVQY Ot8am8QwcuU1jWkMzUTzKftSNmWdmeUKLgKtwSsTm5qNxe88NvFa0inUgQ9CruBk/GwxL xwXncfIPHL9AjpJUV5FwuhBJvM8JnCTOXtpZrBYDbxQvf3/VleclCBieHV+01LXwmP7ws JK5LX6dFHHcVk72UtatzjxhaLSowozV/BH9K/pz1Eh5K1F5V8FQDA9zbNX8OzsBHHejiq dnTsLYZCqnEw45ox6zcwnn1moN1RjNxzRxu1tMdQymdwFk62iGfy+6Gf07ATC/AasJw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796381614; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=nd94p6ABUKpPekQUKu6Z7X0yemLMunWOQ4T0QzpBkDg=; b=Y3wV/Qwl7p7sA71CAxr+Ft0vXc21VMZcpg1WZtxcjj0XkSRoWpLkvWLTfd6wtQcuDx8t WJfckaIlT6DxIuo4rUNp0A2fXVFA49KEK5ajRy6bG3DxmN3rkV2q/zgaVHgdetGg41Z3p COg5LcP1aKYgxHfGBMQLfzCIqPjV0tnxG5RsVVtlWLcOJKts6gygjNJgK6SONaALOmwB3 mGcQ/4d8q6D25XHBuPx6ZCOoiurbuqXKPnsn8YzFu/+EZjdkcZEIZfJ0dafXY2gh0LMiy xuO5DWMXqPseq+12YmlYsr9ZLhfcoGdryhTOMxdfC8KGjjlgVhnT23S2HsmvoyOdHgw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=oYiVkyau; 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 1A338606A32D; Fri, 4 Dec 2026 10:53:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=oYiVkyau Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8C7A51F00934; Fri, 4 Dec 2026 10:53:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796381614; bh=nd94p6ABUKpPekQUKu6Z7X0yemLMunWOQ4T0QzpBkDg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=oYiVkyau3GwAg0IgaA0t3iJcjZ2cq7MwL9VxV9oo7eJ+4k6yGS0uO5o7t+mXc0Ygo we0FGBUtx38EPtEsoW3levIfS6woUXkVKm5lhKTSrUuLeYAluyD1pls4kro3+S+jBP UXdHt0ATKG9nPg4nK8i8aas9zq2mP90jgtspPK50= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Josef Bacik , "David Hildenbrand (Arm)" , Zi Yan , Johannes Weiner , "Vlastimil Babka (SUSE)" , Sasha Levin Subject: [PATCH 6.18 069/703] mm: page_isolation: do not take slab pages for free Date: Fri, 4 Dec 2026 18:59:28 +0900 Message-ID: <20261204100629.551756841@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Josef Bacik [ Upstream commit 213268869301f747d19ca00a391757a6cf2d4fa8 ] page_is_unmovable() regards a page with a reference count of zero as free or about to be freed. Since slab allocates frozen pages, they will be wrongly considered to be freed if order 0 (higher-order compound pages are caught earlier). If such slabs are the only unmovable pages of a memory block, memory offlining now isolates the block, this can lead to offline_pages() looping without progress. Thus detect the slab pages as removable to return -EBUSY, as would happen before commit 9aec2fb0fd5e ("slab: allocate frozen pages"). Fixes: 9aec2fb0fd5e ("slab: allocate frozen pages") Cc: stable@vger.kernel.org Assisted-by: LLM Signed-off-by: Josef Bacik Signed-off-by: David Hildenbrand (Arm) Reviewed-by: Zi Yan Reviewed-by: Johannes Weiner Link: https://patch.msgid.link/20261103-pgalloc-ai-hotfixes-v2-3-e0d2890ab74f@kernel.org Signed-off-by: Vlastimil Babka (SUSE) Signed-off-by: Sasha Levin --- mm/memory_hotplug.c | 7 +++++++ mm/page_isolation.c | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index e62c196dfdfb8..1f29e1a64d181 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -1799,6 +1799,13 @@ static int scan_movable_pages(unsigned long start, unsigned long end, if (PageOffline(page) && page_count(page)) return -EBUSY; + /* + * A page that was allocated, but was not a slab page yet, when + * its pageblock was isolated. + */ + if (PageSlab(page)) + return -EBUSY; + folio = page_folio(page); if (!folio_test_hugetlb(folio)) continue; diff --git a/mm/page_isolation.c b/mm/page_isolation.c index 7a32350eb8c2d..63c29a5527486 100644 --- a/mm/page_isolation.c +++ b/mm/page_isolation.c @@ -66,6 +66,13 @@ bool page_is_unmovable(struct zone *zone, struct page *page, return false; } + /* + * Slab pages are frozen: do not take their reference count of zero + * for that of a free page. + */ + if (PageSlab(page)) + return true; + /* * We can't use page_count without pin a page * because another CPU can free compound page. -- 2.53.0