[PATCH v2 10/47] mm/huge_memory: fix list corruption when deferred_split_scan() races with deferred_split_folio()
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Thu Oct 29 20:40:39 PDT 2026
> Since the deferred split queue became a list_lru, the isolate callback
> moves the folios it took a reference on to an on-stack list, linked
> through folio->_deferred_list, and deferred_split_scan() takes them off
> that list with list_del_init() without holding the list_lru lock.
>
> deferred_split_folio() does not know about the on-stack list. It only
> holds the list_lru lock when it looks at the same list_head, and it can
> run for such a folio: a THP is queued when it is mapped, as a candidate
> for the underused check, and is queued "again" when a part of it gets
> unmapped:
>
> CPU0 deferred_split_scan() CPU1 deferred_split_folio()
> list_del_init(&folio->_deferred_list)
> next->prev = prev
> prev->next = next
> [ ... ]
> Reviewed-by: Johannes Weiner <hannes at cmpxchg.org>
> Reviewed-by: Mani Tofigh <mt4022 at columbia.edu>
> Tested-by: Mani Tofigh <mt4022 at columbia.edu>
> Reviewed-by: Lance Yang <lance.yang at linux.dev>
> Signed-off-by: David Hildenbrand (Arm) <david at kernel.org>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261029-fixes_core-v2-0-a64ce7f83abb@kernel.org?part=10
More information about the kexec
mailing list