Re: [PATCH v1] mm: unqueue deferred split folios outside the lruvec lock

From: Joanne Koong

Date: Wed Oct 14 2026 - 18:23:34 EST


On Wed, Oct 14, 2026 at 2:31 AM David Hildenbrand (Arm)
<david@xxxxxxxxxx> wrote:
>
> > @@ -177,14 +190,10 @@ static void folio_batch_move_lru(struct folio_batch *fbatch, move_fn_t move_fn)
> > *
> > * We're bypassing normal cleanup. Clear flags that are not
> > * applicable to dead folios.
> > - *
> > - * Since the folio may be part of a huge page, unqueue from
> > - * deferred split list to avoid a dangling list entry.
> > */
> > if (is_lru_add && folio_ref_freeze(folio, 1)) {
> > __folio_clear_active(folio);
> > __folio_clear_unevictable(folio);
> > - folio_unqueue_deferred_split(folio);
> > fbatch->folios[i] = NULL;
> > folio_batch_add(&free_fbatch, folio);
> > continue;
> > @@ -201,6 +210,11 @@ static void folio_batch_move_lru(struct folio_batch *fbatch, move_fn_t move_fn)
> >
> > /* Cleanup filtered dead folios. */
> > if (is_lru_add) {
> > + /*
> > + * Since the folios may be part of a huge page, unqueue them
> > + * from the deferred split list to avoid a dangling list entry.
> > + */
>
> In general, this lgtm, thanks. I am confused about this existing comment you are
> moving.
>
> folios being *part of* a huge page? Huh? A folio might represent a huge page,
> but what does the "part of" thing mean here.
>
> Is it simply "Dequeue any large folios" ?

Agreed, I'll reword this to "Unqueue any large folios from the
deferred split queue to avoid a dangling list entry once the folios
are freed".

Thanks,
Joanne