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=1796381618; b=bHpG1AkX0uKNgxkKhVx6dR8aiHtqB6ZtJe9CQmPls+wiaAACF3W1lEhpp+LNMLRhM7BS I1sj/+WInzRpRkDdpQzdRq+RyY3trs0VP2iCoNrwN4PCAJe2Ky9mMjkU8u6e1y8cF2JXZ VDKpXN5RJ71x9gm8h7XZzr7JK86voK8nClOUb7zHI3b0wchV4Juo9SjUm7SkL98cYdtkh 2EeN+Eu1yTVNhL8NliTHzpQzWRhoFvHOMMAJHiJ9CCTzQhYXC19vbFs+mGh7ZQUD8V1Lt OojVvGygDy92VSw4cSIxecs1irFE88l7qH9rc/mVCx/NUzZd7/2fBMA23LjMqzxJDQg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796381618; 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=tBvYQCGlvTx+NBfvOG/bPjowwTGdWgFQIyLIpDowlyI=; b=Dfrr0/TFNt4zb9ppjfJWFKjBo7T2NBxbo6YEbkbpSZdhQq+EABLid9ByLXqEaceHOSMB 2MRZa7F9h0cxL8/smrOOvXOPCELl8jPz6Y7CjPZbL5dWt6VUvGt5eZ6cpvNUjkezaJCqu RftKpffOX1VVGrH5+ocaxWjr5HCWEvP5tA6tKAL0JN5aXvna2/i8KmoEWPre3ky54Hb1u wnsqul0EnOYlO/RePKej4Xtr4S6odKP2GCgmkCBRgQMcKbbYJF22A4e+tr7F+I2Egwk+g 5Y7wfAubR05prDFwSqx78nc6zZ6MCU8QC8JEagvtDutR6A4uzx9zJKEyA7yMF01Gy8g== 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=TJTgPh13; 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 AF297606A33D; Fri, 4 Dec 2026 10:53:38 +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=TJTgPh13 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2770A1F00934; Fri, 4 Dec 2026 10:53:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796381618; bh=tBvYQCGlvTx+NBfvOG/bPjowwTGdWgFQIyLIpDowlyI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=TJTgPh133oVbiobaltppzw/Sq+cdJixdliE5epiw5XBlU8glakFFn4z5lfCiqDI/p 9K+XePiRjRv4WXkcn/dYMtndBDvKQyebqDAO7C7zzb/6+otzkgA/Z9ZaWSJJIib67S clAukJ6Joi7i+qkRY0Ge52jPZpssiWCrKSIfzzo8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Josef Bacik , "Vlastimil Babka (SUSE)" , Sasha Levin Subject: [PATCH 6.18 071/703] mm/page_alloc: remove the zone_spans_pfn() check from get_pfnblock_bitmap_bitidx() Date: Fri, 4 Dec 2026 18:59:30 +0900 Message-ID: <20261204100629.610104559@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: Vlastimil Babka (SUSE) [ Upstream commit 2122887b04f3f2d76daa80055c2c273926032fa0 ] Whenever the flags of a pageblock are read or written, a kernel with CONFIG_DEBUG_VM makes sure that the pfn lies within the zone of the page. Unlike bad_range(), that check reads zone->zone_start_pfn and zone->spanned_pages without zone->span_seqlock. Memory hotplug changes the two fields one after the other. If the lower end of a zone moves, the zone seems to end before its last pages in between. A page of that part which is freed at that moment, on another CPU, ends in page dumped because: VM_BUG_ON_PAGE(!zone_spans_pfn(page_zone(page), pfn)) kernel BUG at mm/page_alloc.c:372! free_unref_folios+0x55e/0xed0 folios_put_refs+0x2b5/0x530 An attempt has been made [1] to fix this with the span seqlock check. But that can trigger all sorts of problems in restricted contexts, as noted by sashiko [2]. Since this is just a sanity debug check and anything with BUG_ON is frowned upon anyway, just remove it altogether. Reported-by: Josef Bacik Closes: https://lore.kernel.org/all/20261027-pgalloc-ai-hotfixes-v1-9-9c7d1aca801e@kernel.org/ [1] Link: https://lore.kernel.org/all/sashiko-outbox-188081@kernel.org/ [2] Fixes: 86051ca5eaf5 ("mm: fix usemap initialization") Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261103-pgalloc-ai-hotfixes-v2-5-e0d2890ab74f@kernel.org Signed-off-by: Vlastimil Babka (SUSE) Signed-off-by: Sasha Levin --- mm/page_alloc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 5cd96eaf8d7ae..9c4d5650f47d0 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -401,7 +401,6 @@ get_pfnblock_bitmap_bitidx(const struct page *page, unsigned long pfn, BUILD_BUG_ON(NR_PAGEBLOCK_BITS != 4); #endif BUILD_BUG_ON(__MIGRATE_TYPE_END > PAGEBLOCK_MIGRATETYPE_MASK); - VM_BUG_ON_PAGE(!zone_spans_pfn(page_zone(page), pfn), page); bitmap = get_pageblock_bitmap(page, pfn); *bitidx = pfn_to_bitidx(page, pfn); -- 2.53.0