[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOUHufavGxeE4nyBnjRMo+BqFyTRUJMyoqBkEDV_c=x-PibvEg@mail.gmail.com>
Date: Thu, 20 Jun 2024 00:12:04 -0600
From: Yu Zhao <yuzhao@...gle.com>
To: Baolin Wang <baolin.wang@...ux.alibaba.com>
Cc: akpm@...ux-foundation.org, hughd@...gle.com, willy@...radead.org,
david@...hat.com, wangkefeng.wang@...wei.com, chrisl@...nel.org,
ying.huang@...el.com, 21cnbao@...il.com, ryan.roberts@....com,
shy828301@...il.com, ziy@...dia.com, ioworker0@...il.com,
da.gomez@...sung.com, p.raghav@...sung.com, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/9] mm: vmscan: add validation before spliting shmem
large folio
On Tue, Jun 18, 2024 at 12:54 AM Baolin Wang
<baolin.wang@...ux.alibaba.com> wrote:
>
> Add swap available space validation before spliting shmem large folio to
> avoid redundant split, since we can not write shmem folio to the swap device
> in this case.
We don't scan anon LRU unless we know we may be able to swap. Even if
there is swap space, we may still not be able to swap. See
can_reclaim_anon_pages().
> Signed-off-by: Baolin Wang <baolin.wang@...ux.alibaba.com>
> ---
> mm/vmscan.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index 1807e5d95dda..61465f92283f 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -1237,6 +1237,14 @@ static unsigned int shrink_folio_list(struct list_head *folio_list,
> }
> } else if (folio_test_swapbacked(folio) &&
> folio_test_large(folio)) {
> +
> + /*
> + * Do not split shmem folio if no swap memory
> + * available.
> + */
> + if (!total_swap_pages)
> + goto activate_locked;
> +
> /* Split shmem folio */
> if (split_folio_to_list(folio, folio_list))
> goto keep_locked;
> --
> 2.39.3
>
>
Powered by blists - more mailing lists