From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3911DC61DCB for ; Fri, 28 Aug 2026 14:35:14 +0000 (UTC) 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:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=X98NIGQPKg+8BL1yOqDNFmiYvUCnib2Cgl3Keq8DNq8=; b=0RBdiPwz66rHD0aPGQD3nOzL5Z YKAqmXEv+ZVj8jEFcPHCIX7/J/agKEMHFVWw+hLmQ6diqc4EObxdqZGAhSU+0C23Fe4J08XYFx24f ZUsi7QAci7w1BUQtb8YfaPOyKJJ5FYzGJNQrzOxk4wftJ2VvrzQh/PiFedVzzp7puUaaAkcAj+Kfb 0jakoVus3LqeJO49Dp34Q57ydxwk8vhB36buPYF17AoTRRXN+4dhPhHaD7Q/cmozNP4cohap+/vmg mj6pJyDzJHhlaTb8tW4FsX7RcUJlPE4TF/xGQZX3SAcxyOaQwl50N141gfeBDZur9PAudgX/6IXLF /k8Wd5NQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wzxfk-0000000603p-1Jqh; Fri, 28 Aug 2026 14:35:12 +0000 Received: from sea.source.kernel.org ([172.234.252.31]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wzxfi-0000000603U-1Egk for kexec@lists.infradead.org; Fri, 28 Aug 2026 14:35:10 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id BC72640A42; Fri, 28 Aug 2026 14:35:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6B0E1F00A3D; Fri, 28 Aug 2026 14:35:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1787927709; bh=X98NIGQPKg+8BL1yOqDNFmiYvUCnib2Cgl3Keq8DNq8=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=AgPYD0dJTuYcc/4B0pRH0o77uVWtQlN95wJO8uRL4lpca5Y4V0l9e7UB1RArFXVuw LcQkfbO3uqF4POebx9cGJ9UpuDDanU9NIxTbjj8F1qRZ1OVOlzpOkyog8rs+aci15w sOuhGNZs5c0COJPv/tIYukcgoSycmNkH5GBAzvkO3qWL1AQvYt9QnxEndwZcjkg66j 256qxj5MGWhnjyB10HbR3BShKR6C/7A2oasEw3JnpHsVMLnBHeJZ3mdk9HdI0W9iS4 qDXqEsFDCPlu0UaQPMZfHa8zvskHNQat9mGBOhsqJlyKr86oHUKYuu/oRtT1OqFUB/ 0m4pR/iYcuyhA== Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfauth.ams.internal (Postfix) with ESMTP id 52C35198008C; Fri, 28 Aug 2026 10:35:04 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-02.internal (MEProxy); Fri, 28 Aug 2026 10:35:07 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTFr1ErFwYp/sqUKdif/sqW6Wb/VLBv2jg+httKCJi0/AiJZkNFzvc+y4ea1xp/ZET 2BvSs8QnzsnCXfGgp2ktatqoulkesBfNz9bNdfY+uqmeKUm8+9HL7ZW9s56lkxowNkQHlS AjzdH/bRfIsBF/KnwpBnDG36NrdV3UW7HS6CG5RjSJMhSI4bpm8wI9kR6EVyq816yX8vGf mRUeK7k3IA6El8JHfKpYwDBMH4psiZovq5zMI+LxcFqzE9+a0akPdGqZRuIJ7dGqwZ5MQT +9kkWrZXPfiDaAA8/1kCqtOBnBva6b1YGyBkk9gQTnzIMyRZEGeSRoa5mI+ZJTmrtyq3dC /nUCEZPuQ2cFYPEkbhCQN9LmCZisqrhzK1YHzoItQBRLyPB6dljqFRiGftTCfOXdrevsNL H0bBBZUB01hFRlOT4YV67+KOI1zTNOR+HuxbIbNLC40+7/gUg9TU4jihypkbo6PjhwQgwJ DfLZcSVXiNu/PpssEtSApwapZhxvgFGbop+tHpV7Md0Q5kViZBZxlKAahyhRpEfPEP74Fz 83Le96qvmhI69sQIroizEz1uSe/5KwR/x+dml0NZFHXTBMwGCbvSVOJpRktkFUUtp0EpBk yVnh1glRHSqB+gOxq4DTr+wtKmcZNouvSfDPqte9/hIi/8Ifqb0rO/pcQAEQ X-ME-Proxy: Feedback-ID: i10464835:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 28 Aug 2026 10:35:02 -0400 (EDT) Date: Fri, 28 Aug 2026 15:35:01 +0100 From: Kiryl Shutsemau To: Breno Leitao Cc: Ard Biesheuvel , Ilias Apalodimas , Miaohe Lin , Naoya Horiguchi , Andrew Morton , kexec@lists.infradead.org, David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, rmikey@meta.com, riel@surriel.com, kernel-team@meta.com Subject: Re: [PATCH v3 5/5] mm/memory-failure: efi: replay the poisioned page in the next kernel Message-ID: References: <20260826-hwpoison-kho-v3-0-6f79c4b605bc@debian.org> <20260826-hwpoison-kho-v3-5-6f79c4b605bc@debian.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260826-hwpoison-kho-v3-5-6f79c4b605bc@debian.org> X-BeenThere: kexec@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "kexec" Errors-To: kexec-bounces+kexec=archiver.kernel.org@lists.infradead.org On Wed, Aug 26, 2026 at 05:03:56AM -0700, Breno Leitao wrote: > diff --git a/mm/mm_init.c b/mm/mm_init.c > index ddda9d6837f32..f94fa221da0b8 100644 > --- a/mm/mm_init.c > +++ b/mm/mm_init.c > @@ -2667,6 +2667,7 @@ void __init mm_core_init(void) > kho_memory_init(); > > memblock_free_all(); > + hwpoison_init_boot(); > mem_init(); > kmem_cache_init(); > /* I don't think it works with deferred page init. With CONFIG_DEFERRED_STRUCT_PAGE_INIT the struct pages above first_deferred_pfn are not initialized here. memmap_init_range() breaks out at defer_init() and the rest is done by page_alloc_init_late(), way past this point. But I think the shape is wrong here, not just the placement. We should flag poisoned pages on the first add to buddy, not after the buddy is initialized. __free_pages_core() already consults the unaccepted table. Adding youre case there seems logical. And all three paths -- memblock_free_pages(), deferred_free_pages() and generic_online_page() -- gets there. No need in special-casing for deferred page init. It also closes the window where the page allocator is live before the frames are taken out of it. And patch 4 seems to be redundant in such shape. -- Kiryl Shutsemau / Kirill A. Shutemov