Re: [PATCH hotfix 1/2] mm/thp: fix deferred split queue not partially_mapped

From: Hugh Dickins
Date: Sun Oct 27 2024 - 01:08:34 EST


On Fri, 25 Oct 2024, Yang Shi wrote:
>
> The other subtle thing is folio->_deferred_list is reused when the
> folio is moved to the local on-stack list. And some

Yes.

> list_empty(deferred_list) checks return true even though the folio is
> actually on the local on-stack list. Some code may depend on or

The code definitely depends on that behaviour: that's how folios get
unqueued when refcount reaches 0, whether they are on the public list
or on the local list at that time.

> inadvertently depend on this behavior. Using folio_batch may break
> some assumptions, but depending on this subtle behavior is definitely
> not reliable IMHO.