2024-02-02 00:15:37

by Yosry Ahmed

[permalink] [raw]
Subject: Re: [PATCH 3/6] mm/zswap: stop lru list shrinking when encounter warm region

On Thu, Feb 01, 2024 at 03:49:03PM +0000, Chengming Zhou wrote:
> When the shrinker encounter an existing folio in swap cache, it means
> we are shrinking into the warmer region. We should terminate shrinking
> if we're in the dynamic shrinker context.
>
> This patch add LRU_STOP to support this, to avoid overshrinking.
>
> Signed-off-by: Chengming Zhou <[email protected]>

LGTM with one comment below.

Reviewed-by: Yosry Ahmed <[email protected]>

> ---
> include/linux/list_lru.h | 1 +
> mm/list_lru.c | 3 +++
> mm/zswap.c | 4 +++-
> 3 files changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/include/linux/list_lru.h b/include/linux/list_lru.h
> index f2882a820690..5633e970144b 100644
> --- a/include/linux/list_lru.h
> +++ b/include/linux/list_lru.h
> @@ -24,6 +24,7 @@ enum lru_status {
> LRU_SKIP, /* item cannot be locked, skip */
> LRU_RETRY, /* item not freeable. May drop the lock
> internally, but has to return locked. */
> + LRU_STOP, /* stop lru list walking */

nit: Should we add "May drop the lock internally, but has to return
locked" like LRU_RETRY and LRU_REMOVED_RETRY?

> };
>
> struct list_lru_one {
[..]


2024-02-02 08:30:12

by Chengming Zhou

[permalink] [raw]
Subject: Re: [PATCH 3/6] mm/zswap: stop lru list shrinking when encounter warm region

On 2024/2/2 08:15, Yosry Ahmed wrote:
> On Thu, Feb 01, 2024 at 03:49:03PM +0000, Chengming Zhou wrote:
>> When the shrinker encounter an existing folio in swap cache, it means
>> we are shrinking into the warmer region. We should terminate shrinking
>> if we're in the dynamic shrinker context.
>>
>> This patch add LRU_STOP to support this, to avoid overshrinking.
>>
>> Signed-off-by: Chengming Zhou <[email protected]>
>
> LGTM with one comment below.
>
> Reviewed-by: Yosry Ahmed <[email protected]>
>
>> ---
>> include/linux/list_lru.h | 1 +
>> mm/list_lru.c | 3 +++
>> mm/zswap.c | 4 +++-
>> 3 files changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/include/linux/list_lru.h b/include/linux/list_lru.h
>> index f2882a820690..5633e970144b 100644
>> --- a/include/linux/list_lru.h
>> +++ b/include/linux/list_lru.h
>> @@ -24,6 +24,7 @@ enum lru_status {
>> LRU_SKIP, /* item cannot be locked, skip */
>> LRU_RETRY, /* item not freeable. May drop the lock
>> internally, but has to return locked. */
>> + LRU_STOP, /* stop lru list walking */
>
> nit: Should we add "May drop the lock internally, but has to return
> locked" like LRU_RETRY and LRU_REMOVED_RETRY?

Right, will add.

Thanks.