Re: [PATCH] mm/huge_memory: use READ_ONCE() when cloning folio flags during split
From: David Hildenbrand (Arm)
Date: Thu Oct 29 2026 - 06:48:05 EST
On 10/29/26 10:08, Barry Song wrote:
> On Thu, Oct 29, 2026 at 3:41 PM Ye Liu <ye.liu@xxxxxxxxx> wrote:
>>
>> From: Ye Liu <liuye@xxxxxxxxxx>
>>
>> The head folio's flags are read as a whole word to clone specific bits
>> into tail folios during a THP split. This plain read can race with
>> concurrent atomic flag modifications such as folio_set_waiters()
>> (PG_waiters), as reported by KCSAN:
>>
>> BUG: KCSAN: data-race in __split_huge_page_tail / migration_entry_wait_on_locked
>>
>> Signed-off-by: Ye Liu <liuye@xxxxxxxxxx>
>> ---
>
> I assume the race is harmless, but silencing KCSAN is still worthwhile.
Isn't there a way we could lose the PG_waiters flag?
--
Cheers,
David