From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 2ACA93CFF4D for ; Fri, 28 Aug 2026 14:35:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787927711; cv=none; b=sUQCfQGYuEjm0Oq/pqKOikMUAjyEp6X36iMT4H5hq4vLAATdWk7uO7qSk+/4HE79rew0Qx38Y1hWZJpmeM6fFAKIkcVnWf+W5h6aIrjvfxOoBciwfd2BXUL+5fpmsNMIZY0hir8C1jVT4Azdg9gkMf7fJlnfZvhO+5N57uKuER0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787927711; c=relaxed/simple; bh=4vLhgOAWJfhHB9C5k+hA8EmZVp3gB6NlTS87ovCpJAw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=kNiv/XvmvqUQw1i5RyH3beOAKptT0ZeKyWub/HtMqAUPUagxtuVO1mY0Or2yfQBdprudiW1Rp5EGG5px1uPB6LH6Iryc8LPoCBSNcM0hKfkDmjnk4lC5Ek+xfXT2n/3dRl6n8uxkIIqq2X7ZOmy/9Q0dmfvjuhY08eXxQ2xkCuw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AgPYD0dJ; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AgPYD0dJ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D06991F000E9; 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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> 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