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: <9b2f8385-735b-4341-b521-a42c9a9cb04c@bytedance.com>
Date: Fri, 19 Jan 2024 14:18:54 +0800
From: Chengming Zhou <zhouchengming@...edance.com>
To: Chris Li <chrisl@...nel.org>
Cc: Yosry Ahmed <yosryahmed@...gle.com>,
 Andrew Morton <akpm@...ux-foundation.org>, linux-kernel@...r.kernel.org,
 linux-mm@...ck.org, Wei Xu <weixugc@...gle.com>,
 Yu Zhao <yuzhao@...gle.com>, Greg Thelen <gthelen@...gle.com>,
 Chun-Tse Shao <ctshao@...gle.com>, Suren Baghdasaryan
 <surenb@...gle.com>, Brain Geffon <bgeffon@...gle.com>,
 Minchan Kim <minchan@...nel.org>, Michal Hocko <mhocko@...e.com>,
 Mel Gorman <mgorman@...hsingularity.net>, Huang Ying <ying.huang@...el.com>,
 Nhat Pham <nphamcs@...il.com>, Johannes Weiner <hannes@...xchg.org>,
 Kairui Song <kasong@...cent.com>, Zhongkun He
 <hezhongkun.hzk@...edance.com>, Kemeng Shi <shikemeng@...weicloud.com>,
 Barry Song <v-songbaohua@...o.com>,
 "Matthew Wilcox (Oracle)" <willy@...radead.org>,
 "Liam R. Howlett" <Liam.Howlett@...cle.com>,
 Joel Fernandes <joel@...lfernandes.org>
Subject: Re: [PATCH 0/2] RFC: zswap tree use xarray instead of RB tree

On 2024/1/19 12:59, Chris Li wrote:
> On Wed, Jan 17, 2024 at 11:35 PM Chengming Zhou
> <zhouchengming@...edance.com> wrote:
> 
>>>>>                     mm-stable           zswap-split-tree    zswap-xarray
>>>>> real                1m10.442s           1m4.157s            1m9.962s
>>>>> user                17m48.232s          17m41.477s          17m45.887s
>>>>> sys                 8m13.517s           5m2.226s            7m59.305s
>>>>>
>>>>> Looks like the contention of concurrency is still there, I haven't
>>>>> look into the code yet, will review it later.
>>>
>>> Thanks for the quick test. Interesting to see the sys usage drop for
>>> the xarray case even with the spin lock.
>>> Not sure if the 13 second saving is statistically significant or not.
>>>
>>> We might need to have both xarray and split trees for the zswap. It is
>>> likely removing the spin lock wouldn't be able to make up the 35%
>>> difference. That is just my guess. There is only one way to find out.
>>
>> Yes, I totally agree with this! IMHO, concurrent zswap_store paths still
>> have to contend for the xarray spinlock even though we would have converted
>> the rb-tree to the xarray structure at last. So I think we should have both.
>>
>>>
>>> BTW, do you have a script I can run to replicate your results?
> 
> Hi Chengming,
> 
> Thanks for your script.
> 
>>
>> ```
>> #!/bin/bash
>>
>> testname="build-kernel-tmpfs"
>> cgroup="/sys/fs/cgroup/$testname"
>>
>> tmpdir="/tmp/vm-scalability-tmp"
>> workdir="$tmpdir/$testname"
>>
>> memory_max="$((2 * 1024 * 1024 * 1024))"
>>
>> linux_src="/root/zcm/linux-6.6.tar.xz"
>> NR_TASK=32
>>
>> swapon ~/zcm/swapfile
> 
> How big is your swapfile here?

The swapfile is big enough here, I use a 50GB swapfile.

> 
> It seems you have only one swapfile there. That can explain the contention.
> Have you tried multiple swapfiles for the same test?
> That should reduce the contention without using your patch.
Do you mean to have many 64MB swapfiles to swapon at the same time?
Maybe it's feasible to test, I'm not sure how swapout will choose.
But in our usecase, we normally have only one swapfile.

Thanks.

> 
> Chris
> 
>> echo 60 > /proc/sys/vm/swappiness
>>
>> echo zsmalloc > /sys/module/zswap/parameters/zpool
>> echo lz4 > /sys/module/zswap/parameters/compressor
>> echo 1 > /sys/module/zswap/parameters/shrinker_enabled
>> echo 1 > /sys/module/zswap/parameters/enabled
>>
>> if ! [ -d $tmpdir ]; then
>>         mkdir -p $tmpdir
>>         mount -t tmpfs -o size=100% nodev $tmpdir
>> fi
>>
>> mkdir -p $cgroup
>> echo $memory_max > $cgroup/memory.max
>> echo $$ > $cgroup/cgroup.procs
>>
>> rm -rf $workdir
>> mkdir -p $workdir
>> cd $workdir
>>
>> tar xvf $linux_src
>> cd linux-6.6
>> make -j$NR_TASK clean
>> make defconfig
>> time make -j$NR_TASK
>> ```
>>
>>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ