Re: [PATCH] mm/huge_memory: use READ_ONCE() when cloning folio flags during split
From: Barry Song
Date: Thu Oct 29 2026 - 05:14:52 EST
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.
Reviewed-by: Barry Song <baohua@xxxxxxxxxx>