Re: [PATCH] mm/huge_memory: use READ_ONCE() when cloning folio flags during split
From: David Hildenbrand (Arm)
Date: Thu Oct 29 2026 - 10:54:42 EST
On 10/29/26 15:31, Zi Yan wrote:
> On Thu Oct 29, 2026 at 6:47 AM EDT, David Hildenbrand (Arm) wrote:
>> On 10/29/26 10:08, Barry Song wrote:
>>>
>>> I assume the race is harmless, but silencing KCSAN is still worthwhile.
>
> data_race() would work too.
>
>>
>> Isn't there a way we could lose the PG_waiters flag?
>
> The PG_waiters on the original folio/the original head page is not lost,
Ah, so it's not on arbitrary tail pages, just the old head.
> but there is a chance PG_waiters is lost in the new head, because
> prep_compound_page() uses __SetPageHead() and can ignore the atomic set
> of PG_waiters.
Fun.
...>
> Solutions can be:
>
> 1. Use atomic SetPageHead() in prep_compound_page().
That sounds like the right thing to do?
--
Cheers,
David