Re: [PATCH 10/46] mm/huge_memory: fix list corruption when deferred_split_scan() races with deferred_split_folio()

From: Mani Tofigh

Date: Tue Oct 27 2026 - 14:04:26 EST




On 10/27/26 11:15 AM, David Hildenbrand (Arm) wrote:
While I have your attention: This variant works, a different proposal used

list_del_init_careful()

instead. However, that is documented to require list_empty_careful().

Do you think it's worth looking into?


https://lore.kernel.org/all/20261026-thpsplit-careful-v1-1-d357d70fd6f4@xxxxxxxxxxxx/

In this case the careful variant is fine without
list_empty_careful() since it writes ->prev first
and then ->next with smp_store_release(), and
__list_lru_add() only writes to the entry after it
sees -> next == entry so it can't race with the ->prev
write anymore.

But your version also covers the PG_partially_mapped
race your comment mentions, which mine doesn't, so
it's the more complete fix anyway.

Thanks,
Mani