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]
Message-ID: <1e5ffefa-8c80-44b8-986f-ee574c3b3349@bytedance.com>
Date: Tue, 13 Feb 2024 22:31:16 +0800
From: Chengming Zhou <zhouchengming@...edance.com>
To: Yosry Ahmed <yosryahmed@...gle.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
 Johannes Weiner <hannes@...xchg.org>, Nhat Pham <nphamcs@...il.com>,
 linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] mm/zswap: change zswap_pool kref to percpu_ref

On 2024/2/13 06:42, Yosry Ahmed wrote:
> On Sun, Feb 11, 2024 at 5:58 AM Chengming Zhou
> <zhouchengming@...edance.com> wrote:
>>
>> All zswap entries will take a reference of zswap_pool when
>> zswap_store(), and drop it when free. Change it to use the
>> percpu_ref is better for scalability performance.
>>
>> Testing kernel build in tmpfs with memory.max=2GB
>> (zswap shrinker and writeback enabled with one 50GB swapfile).
>>
>>         mm-unstable  zswap-global-lru
>> real    63.20        63.12
>> user    1061.75      1062.95
>> sys     268.74       264.44
> 
> Are these numbers from a single run or the average of multiple runs?

The average of 5 runs. And I just checked/compared each run result,
the improvement is stable. So yes, it should be a real performance gain.

> It just seems that the improvement is small, and percpu refcnt is
> slightly less intuitive (and uses a bit more memory), so let's make
> sure there is a real performance gain first.

Right, percpu_ref use a bit more memory which should be ok for our use case,
since we almost have only one zswap_pool to be using. The performance gain is
for zswap_store/load hotpath.

> 
> It would also be useful to mention how many threads/CPUs are being used here.

My bad, the testing uses 32 threads on a 128 CPUs x86-64 machine.

Thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ