From: Sergey Senozhatsky <senozhatsky@chromium.org>
To: Nhat Pham <nphamcs@gmail.com>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>,
Andrew Morton <akpm@linux-foundation.org>,
Yosry Ahmed <yosry.ahmed@linux.dev>,
Minchan Kim <minchan@kernel.org>,
Johannes Weiner <hannes@cmpxchg.org>,
Brian Geffon <bgeffon@google.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [RFC PATCH] zsmalloc: make common caches global
Date: Tue, 20 Jan 2026 10:19:13 +0900 [thread overview]
Message-ID: <qs7qfzsldjz4fd3lozlm72p2vmebzxvsxos76r2h4gvjc555un@3mfigywcnenv> (raw)
In-Reply-To: <CAKEwX=PxJo6RijehmJMz+kK45Qr9AcQMCedO7KY_+GWzsW20tQ@mail.gmail.com>
On (26/01/19 13:43), Nhat Pham wrote:
> On Thu, Jan 15, 2026 at 8:49 PM Sergey Senozhatsky
> <senozhatsky@chromium.org> wrote:
> >
> > Currently, zsmalloc creates kmem_cache of handles and zspages
> > for each pool, which may be suboptimal from the memory usage
> > point of view (extra internal fragmentation per pool). Systems
> > that create multiple zsmalloc pools may benefit from shared
> > common zsmalloc caches.
> >
> > Make handles and zspages kmem caches global.
>
> Hmm yeah this sounds reasonable to me. No reason to have dedicated
> kmem_cache per zs_pool (in the case of zswap, I suppose it's one for
> each compression algorithm, which is usually just one - but still...).
>
> Is there any lock contention implications?
cache_alloc_handle()/cache_alloc_zspage() (and their free counterparts)
are called outside of scope of any zsmalloc locks, so the upper boundary
on the number of concurrent callers is the same - num_online_cpus().
prev parent reply other threads:[~2026-01-20 1:19 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-16 4:48 Sergey Senozhatsky
2026-01-16 5:52 ` Sergey Senozhatsky
2026-01-19 21:44 ` Nhat Pham
2026-01-21 3:41 ` Sergey Senozhatsky
2026-01-21 23:58 ` Yosry Ahmed
2026-01-22 3:28 ` Sergey Senozhatsky
2026-01-22 3:39 ` Yosry Ahmed
2026-01-22 3:55 ` Sergey Senozhatsky
2026-01-16 20:49 ` Yosry Ahmed
2026-01-17 2:24 ` Sergey Senozhatsky
2026-01-21 1:30 ` Yosry Ahmed
2026-01-21 1:56 ` Sergey Senozhatsky
2026-01-19 21:43 ` Nhat Pham
2026-01-20 1:19 ` Sergey Senozhatsky [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=qs7qfzsldjz4fd3lozlm72p2vmebzxvsxos76r2h4gvjc555un@3mfigywcnenv \
--to=senozhatsky@chromium.org \
--cc=akpm@linux-foundation.org \
--cc=bgeffon@google.com \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan@kernel.org \
--cc=nphamcs@gmail.com \
--cc=yosry.ahmed@linux.dev \
/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