linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yosry Ahmed <yosryahmed@google.com>
To: Chengming Zhou <zhouchengming@bytedance.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	 Nhat Pham <nphamcs@gmail.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] mm/zswap: change zswap_pool kref to percpu_ref
Date: Tue, 13 Feb 2024 17:45:26 +0000	[thread overview]
Message-ID: <ZcuqtiIsAmDedOqK@google.com> (raw)
In-Reply-To: <1e5ffefa-8c80-44b8-986f-ee574c3b3349@bytedance.com>

On Tue, Feb 13, 2024 at 10:31:16PM +0800, Chengming Zhou wrote:
> On 2024/2/13 06:42, Yosry Ahmed wrote:
> > On Sun, Feb 11, 2024 at 5:58 AM Chengming Zhou
> > <zhouchengming@bytedance.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 for the clarification. Please include such details in the commit
message.


      reply	other threads:[~2024-02-13 17:45 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-11 13:57 [PATCH 0/2] mm/zswap: optimize for dynamic zswap_pools Chengming Zhou
2024-02-11 13:57 ` [PATCH 1/2] mm/zswap: global lru and shrinker shared by all zswap_pools Chengming Zhou
2024-02-11 19:01   ` kernel test robot
2024-02-12 13:17     ` Chengming Zhou
2024-02-11 21:04   ` Nhat Pham
2024-02-12 13:20     ` Chengming Zhou
2024-02-11 22:05   ` kernel test robot
2024-02-13 12:57   ` Yosry Ahmed
2024-02-13 14:20     ` Chengming Zhou
2024-02-13 17:43       ` Yosry Ahmed
2024-02-11 13:57 ` [PATCH 2/2] mm/zswap: change zswap_pool kref to percpu_ref Chengming Zhou
2024-02-11 21:21   ` Nhat Pham
2024-02-12 13:29     ` Chengming Zhou
2024-02-12 18:53       ` Nhat Pham
2024-02-13 14:22         ` Chengming Zhou
2024-02-12 22:42   ` Yosry Ahmed
2024-02-13 14:31     ` Chengming Zhou
2024-02-13 17:45       ` Yosry Ahmed [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZcuqtiIsAmDedOqK@google.com \
    --to=yosryahmed@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nphamcs@gmail.com \
    --cc=zhouchengming@bytedance.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox