Re: [RFC PATCH v2 4/4] madvise: avoid trying to split large folio always in cold_pageout

From: Yu Zhao
Date: Tue Jul 25 2023 - 01:27:10 EST


On Fri, Jul 21, 2023 at 3:41 AM Yin Fengwei <fengwei.yin@xxxxxxxxx> wrote:
>
> Current madvise_cold_or_pageout_pte_range() always tries to split
> large folio.
>
> Avoid trying to split large folio always by:
> - if large folio is in the request range, don't split it. Leave
> to page reclaim to decide whether the large folio needs be
> split.
> - if large folio crosses boundaries of request range, skip it if
> it's page cache. Try to split it if it's anonymous large folio.
> If failed to split it, just skip it.
>
> Invoke folio_referenced() to clear the A bit for large folio. As it
> will acquire pte lock, just do it after release pte lock.
>
> Signed-off-by: Yin Fengwei <fengwei.yin@xxxxxxxxx>

I currently don't have the bandwidth to look at this one. Minchan, can
you please take a look? Thanks.