Re: [PATCH v10] mm: shrink skip folio mapped by an exiting process

From: Andrew Morton
Date: Wed Jul 24 2024 - 15:55:25 EST


On Wed, 10 Jul 2024 16:36:41 +0800 Zhiguo Jiang <justinjiang@xxxxxxxx> wrote:

> The releasing process of the non-shared anonymous folio mapped solely by
> an exiting process may go through two flows: 1) the anonymous folio is
> firstly is swaped-out into swapspace and transformed into a swp_entry
> in shrink_folio_list; 2) then the swp_entry is released in the process
> exiting flow. This will result in the high cpu load of releasing a
> non-shared anonymous folio mapped solely by an exiting process.
>
> When the low system memory and the exiting process exist at the same
> time, it will be likely to happen, because the non-shared anonymous
> folio mapped solely by an exiting process may be reclaimed by
> shrink_folio_list.
>
> This patch is that shrink skips the non-shared anonymous folio solely
> mapped by an exting process and this folio is only released directly in
> the process exiting flow, which will save swap-out time and alleviate
> the load of the process exiting.

Has any testing been performed to demonstrate any benefit? If so, what
were the results?