Re: [PATCH] mm/huge_memory: set PG_has_hwpoisoned only after new folio head is established
From: Rik van Riel
Date: Wed Jul 01 2026 - 12:29:45 EST
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:
> >
> > @@ -3612,6 +3608,18 @@ static void __split_folio_to_order(struct
> > folio *folio, int old_order,
> > folio_set_large_rmappable(new_folio);
> > }
> >
> > + /*
> > + * PG_has_hwpoisoned is a FOLIO_SECOND_PAGE flag,
> > so it can only
> > + * be set once @new_folio is a real (head) folio.
> > 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 != 0.
> > + */
>
> This reads like an LLM comment...! A ton of noise and unnecessary
> detail.
>
> How about:
>
> /*
> * 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@xxxxxxxxxx on v2.
thank you for the review,
Rik
--
All Rights Reversed.