From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (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 E413436F8EE for ; Wed, 1 Jul 2026 16:29:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=96.67.55.147 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782923381; cv=none; b=K6S4ChP0MqQxBmkV6zejlO6HwZ/v3VJL16RiJPw1HydSalR0GFr8aP8lZI/X3Y5UlUAnZWWDwcq0DFX/3KLLIm7SuC+2ivrxlhdMBjl3vCID3xMb5AakdaDyvB87jmBf4NGqE9nJTxE50UhlX54Z7PQzQeGXi3QYbBxd/7F6jXs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782923381; c=relaxed/simple; bh=KM9/tjS1TbFml8goSmQ8iaX0NXk4QMeZ9e9vEyOokhc=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=YrWSNOBJUl67Df+axcrnEIiwTg8NUJWwycH6KPhM4tifBlkks4ZcPzWkgBVBhdjbnTksFOEZRvwjt+VyDRnfT+Zz8dpzwYAy0GLHXTxsgV+QC+6ITtcV+ehmIIjVVG9OtnX4TrcjLpw5r0qsKyK+dzAh3ZQVabcxp5Ou8AuLKEE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=surriel.com; spf=pass smtp.mailfrom=surriel.com; dkim=pass (2048-bit key) header.d=surriel.com header.i=@surriel.com header.b=FgH4di24; arc=none smtp.client-ip=96.67.55.147 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=surriel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=surriel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=surriel.com header.i=@surriel.com header.b="FgH4di24" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=surriel.com ; s=mail; h=MIME-Version:Content-Transfer-Encoding:Content-Type:References: In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=tb2r/RbeBZvgi8wyzBGYRLANjPVEwwlWhAAzex/BFMw=; b=FgH4di241b3H1BW94w7v0C1trF pnsNbPgcnPRkK1L7KlrwB3AwZSdLxgaAPiPab1qX32aLqqklBe9TfNn04TwgvzAK/otSlC1PZfD8M X/7Odv3kbv5QgTDsraxFqaJwxIxnVE6fXYpj3QdVHqoCL4iFJv+z4ZN9pEwtrjzMhocnfrBZj41zc ODK17Vp8RopwjPpyXxAOX8cUI3hzmKWihZl5I2L9+x9Bn4PRF2KzzxZGuasUCLqcU0iO0gdKI5GVC 2TjWco6/ahsubvAYKEpmZx5lboaYocv9WsfjUw4AfruL4sMMwmSUCwt7xDLPUfcuPFiZoFaRK2L19 sQZKwxLQ==; Received: from fangorn.home.surriel.com ([10.0.13.7]) by shelob.surriel.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.97.1) (envelope-from ) id 1wexoT-000000000Wr-1rUv; Wed, 01 Jul 2026 12:29:25 -0400 Message-ID: Subject: Re: [PATCH] mm/huge_memory: set PG_has_hwpoisoned only after new folio head is established From: Rik van Riel To: Lorenzo Stoakes Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com, linux-mm@kvack.org, akpm@linux-foundation.org, david@kernel.org, ziy@nvidia.com, baolin.wang@linux.alibaba.com, liam@infradead.org, npache@redhat.com, ryan.roberts@arm.com, dev.jain@arm.com, baohua@kernel.org, lance.yang@linux.dev, yang@os.amperecomputing.com Date: Wed, 01 Jul 2026 12:29:25 -0400 In-Reply-To: References: <20260701134622.3152896-1-riel@surriel.com> Autocrypt: addr=riel@surriel.com; prefer-encrypt=mutual; keydata=mQENBFIt3aUBCADCK0LicyCYyMa0E1lodCDUBf6G+6C5UXKG1jEYwQu49cc/gUBTTk33A eo2hjn4JinVaPF3zfZprnKMEGGv4dHvEOCPWiNhlz5RtqH3SKJllq2dpeMS9RqbMvDA36rlJIIo47 Z/nl6IA8MDhSqyqdnTY8z7LnQHqq16jAqwo7Ll9qALXz4yG1ZdSCmo80VPetBZZPw7WMjo+1hByv/ lvdFnLfiQ52tayuuC1r9x2qZ/SYWd2M4p/f5CLmvG9UcnkbYFsKWz8bwOBWKg1PQcaYHLx06sHGdY dIDaeVvkIfMFwAprSo5EFU+aes2VB2ZjugOTbkkW2aPSWTRsBhPHhV6dABEBAAG0HlJpayB2YW4gU mllbCA8cmllbEByZWRoYXQuY29tPokBHwQwAQIACQUCW5LcVgIdIAAKCRDOed6ShMTeg05SB/986o gEgdq4byrtaBQKFg5LWfd8e+h+QzLOg/T8mSS3dJzFXe5JBOfvYg7Bj47xXi9I5sM+I9Lu9+1XVb/ r2rGJrU1DwA09TnmyFtK76bgMF0sBEh1ECILYNQTEIemzNFwOWLZZlEhZFRJsZyX+mtEp/WQIygHV WjwuP69VJw+fPQvLOGn4j8W9QXuvhha7u1QJ7mYx4dLGHrZlHdwDsqpvWsW+3rsIqs1BBe5/Itz9o 6y9gLNtQzwmSDioV8KhF85VmYInslhv5tUtMEppfdTLyX4SUKh8ftNIVmH9mXyRCZclSoa6IMd635 Jq1Pj2/Lp64tOzSvN5Y9zaiCc5FucXtB9SaWsgdmFuIFJpZWwgPHJpZWxAc3VycmllbC5jb20+iQE +BBMBAgAoBQJSLd2lAhsjBQkSzAMABgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRDOed6ShMTe g4PpB/0ZivKYFt0LaB22ssWUrBoeNWCP1NY/lkq2QbPhR3agLB7ZXI97PF2z/5QD9Fuy/FD/jddPx KRTvFCtHcEzTOcFjBmf52uqgt3U40H9GM++0IM0yHusd9EzlaWsbp09vsAV2DwdqS69x9RPbvE/Ne fO5subhocH76okcF/aQiQ+oj2j6LJZGBJBVigOHg+4zyzdDgKM+jp0bvDI51KQ4XfxV593OhvkS3z 3FPx0CE7l62WhWrieHyBblqvkTYgJ6dq4bsYpqxxGJOkQ47WpEUx6onH+rImWmPJbSYGhwBzTo0Mm G1Nb1qGPG+mTrSmJjDRxrwf1zjmYqQreWVSFEt26tBpSaWsgdmFuIFJpZWwgPHJpZWxAZmIuY29tP okBPgQTAQIAKAUCW5LbiAIbIwUJEswDAAYLCQgHAwIGFQgCCQoLBBYCAwECHgECF4AACgkQznneko TE3oOUEQgAsrGxjTC1bGtZyuvyQPcXclap11Ogib6rQywGYu6/Mnkbd6hbyY3wpdyQii/cas2S44N cQj8HkGv91JLVE24/Wt0gITPCH3rLVJJDGQxprHTVDs1t1RAbsbp0XTksZPCNWDGYIBo2aHDwErhI omYQ0Xluo1WBtH/UmHgirHvclsou1Ks9jyTxiPyUKRfae7GNOFiX99+ZlB27P3t8CjtSO831Ij0Ip QrfooZ21YVlUKw0Wy6Ll8EyefyrEYSh8KTm8dQj4O7xxvdg865TLeLpho5PwDRF+/mR3qi8CdGbkE c4pYZQO8UDXUN4S+pe0aTeTqlYw8rRHWF9TnvtpcNzZw== Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.2 (3.56.2-2.fc42) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Wed, 2026-07-01 at 15:52 +0100, Lorenzo Stoakes wrote: > On Wed, Jul 01, 2026 at 09:46:22AM -0400, Rik van Riel wrote: > >=20 > > @@ -3612,6 +3608,18 @@ static void __split_folio_to_order(struct > > folio *folio, int old_order, > > =C2=A0 folio_set_large_rmappable(new_folio); > > =C2=A0 } > >=20 > > + /* > > + * PG_has_hwpoisoned is a FOLIO_SECOND_PAGE flag, > > so it can only > > + * be set once @new_folio is a real (head) folio.=C2=A0 > > Defer setting > > + * it until after > > clear_compound_head()/prep_compound_page() have > > + * turned @new_head from a tail page into a proper > > folio head; > > + * otherwise folio_flags() trips on (page- > > >compound_info & 1). > > + * handle_hwpoison implies new_order !=3D 0. > > + */ >=20 > This reads like an LLM comment...! A ton of noise and unnecessary > detail. >=20 > How about: >=20 > /* > * PG_has_hwpoisoned is on the 2nd page, so set it > after > * compound head prepped. > */ It was an LLM comment, indeed. I harvest these syzkaller fixes from an automated run every once in a while, where the fix is "verified" by checking whether the issue can still reproduce after a tentative fix has been applied. I've fixed up the comment as suggested, and will CC: stable@kernel.org on v2. thank you for the review, Rik --=20 All Rights Reversed.