Re: [PATCH] mm/vmscan: drop checking if _deferred_list is empty before using TTU_SYNC
From: Andrew Morton
Date: Tue Jul 02 2024 - 02:32:42 EST
On Mon, 1 Jul 2024 21:35:41 +1200 Barry Song <21cnbao@xxxxxxxxx> wrote:
> > > +++ b/mm/vmscan.c
> > > @@ -1291,7 +1291,7 @@ static unsigned int shrink_folio_list(struct list_head *folio_list,
> > > * try_to_unmap acquire PTL from the first PTE,
> > > * eliminating the influence of temporary PTE values.
> > > */
> > > - if (folio_test_large(folio) && list_empty(&folio->_deferred_list))
> > > + if (folio_test_large(folio))
> >
> > As it stands, the list_empty() technically needs a data_race() annotation. I
> > think your original patch went into v6.10-rc1? If so, perhaps it makes sense to
> > try to get this into the next rc?
>
> Either way is fine. Hi Andrew, if you include it for the next RC, could you
> please add this tag?
>
> Fixes: 73bc32875ee9 ("mm: hold PTL from the first PTE while reclaiming
> a large folio")
Nope! That invites people to backport this change into kernels which
don't contain Ryan's 5ed890ce5147 ("mm: vmscan: avoid split during
shrink_folio_list()").
I'll simply queue this in the normal fashion.
> And an additional changelog:
>
> Additionally, the list_empty() technically requires a data_race() annotation.
Done, thanks.