lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 12 Feb 2024 21:20:19 +0800
From: Chengming Zhou <zhouchengming@...edance.com>
To: Nhat Pham <nphamcs@...il.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
 Johannes Weiner <hannes@...xchg.org>, Yosry Ahmed <yosryahmed@...gle.com>,
 linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] mm/zswap: global lru and shrinker shared by all
 zswap_pools

On 2024/2/12 05:04, Nhat Pham wrote:
> On Sun, Feb 11, 2024 at 5:57 AM Chengming Zhou
> <zhouchengming@...edance.com> wrote:
>>
>> Dynamic zswap_pool creation may create/reuse to have multiple
>> zswap_pools in a list, only the first will be current used.
>>
>> Each zswap_pool has its own lru and shrinker, which is not
>> necessary and has its problem:
>>
>> 1. When memory has pressure, all shrinker of zswap_pools will
>>    try to shrink its own lru, there is no order between them.
>>
>> 2. When zswap limit hit, only the last zswap_pool's shrink_work
>>    will try to shrink its lru, which is inefficient.
>>
>> Anyway, having a global lru and shrinker shared by all zswap_pools
>> is better and efficient.
>>
>> Signed-off-by: Chengming Zhou <zhouchengming@...edance.com>
> 
> I'll do a careful review later, but IMO this is a good idea :)

Ok, thanks, take your time. :)

> 
> Chris pointed out when he reviewed the zswap shrinker patch series
> that the reclaim algorithm has to decide which pool to reclaim from,
> and I have always thought that it was a bit weird that we have to do
> it at all. We should reclaim stored objects by access ordering,
> irregardless of which pool it belongs to. Having a shared LRU and
> other associated reclaim structures is sound, and saves a bit of space
> too while we're at it.

Right, agree!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ