From: Yosry Ahmed <yosry.ahmed@linux.dev>
To: Seth Jennings <sjenning@redhat.com>
Cc: Vlastimil Babka <vbabka@suse.cz>,
Andrew Morton <akpm@linux-foundation.org>,
Vitaly Wool <vitaly.wool@konsulko.com>,
Miaohe Lin <linmiaohe@huawei.com>,
Johannes Weiner <hannes@cmpxchg.org>,
Nhat Pham <nphamcs@gmail.com>,
Chengming Zhou <chengming.zhou@linux.dev>,
Huacai Chen <chenhuacai@kernel.org>,
Dan Streetman <ddstreet@ieee.org>,
WANG Xuerui <kernel@xen0n.name>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
loongarch@lists.linux.dev
Subject: Re: [PATCH 1/2] mm: zbud: deprecate CONFIG_ZBUD
Date: Tue, 28 Jan 2025 16:45:24 +0000 [thread overview]
Message-ID: <Z5kJpCtpfH3bJrbE@google.com> (raw)
In-Reply-To: <CAC8qmcDZ8DeXEX23N0Xscjg_wR6HKL=AVE_5Y+68gCeLzv4bEQ@mail.gmail.com>
On Tue, Jan 28, 2025 at 10:04:27AM -0600, Seth Jennings wrote:
> On Tue, Jan 28, 2025 at 9:37 AM Yosry Ahmed <yosry.ahmed@linux.dev> wrote:
> >
> > On Tue, Jan 28, 2025 at 11:21:10AM +0100, Vlastimil Babka wrote:
> > > On 1/28/25 00:58, Yosry Ahmed wrote:
> > > > The zbud compressed pages allocator is rarely used, most users use
> > > > zsmalloc. zbud consumes much more memory (only stores 1 or 2 compressed
> > > > pages per physical page). The only advantage of zbud is a marginal
> > > > performance improvement that by no means justify the memory overhead.
> > > >
> > > > Historically, zsmalloc had significantly worse latency than zbud and
> > > > z3fold but offered better memory savings. This is no longer the case as
> > > > shown by a simple recent analysis [1]. In a kernel build test on tmpfs
> > > > in a limited cgroup, zbud 2-3% less time than zsmalloc, but at the cost
> > > > of using ~32% more memory (1.5G vs 1.13G). The tradeoff does not make
> > > > sense for zbud in any practical scenario.
> > > >
> > > > The only alleged advantage of zbud is not having the dependency on
> > > > CONFIG_MMU, but CONFIG_SWAP already depends on CONFIG_MMU anyway, and
> > > > zbud is only used by zswap.
> > > >
> > > > Following in the footsteps of [2], which deprecated z3fold, deprecated
> > > > zbud as planned and remove it in a few cycles if no objections are
> > > > raised from active users.
> > > >
> > > > Rename the user-visible config options so that users with CONFIG_ZBUD=y
> > > > get a new prompt with explanation during make oldconfig. Also, remove
> > > > CONFIG_ZBUD from defconfig.
> > > >
> > > > [1]https://lore.kernel.org/lkml/CAJD7tkbRF6od-2x_L8-A1QL3=2Ww13sCj4S3i4bNndqF+3+_Vg@mail.gmail.com/
> > > > [2]https://lore.kernel.org/lkml/20240904233343.933462-1-yosryahmed@google.com/
> > > >
> > > > Signed-off-by: Yosry Ahmed <yosry.ahmed@linux.dev>
> > >
> > > Seems weird not to Cc the folks listed in MAINTAINERS for ZBUD? Unless their
> > > addresses are known to bounce?
> >
> > Ugh I had them in the CC list, but I played around with it and probably
> > lost them :/
> >
> > Seth, Dan, apologies.
>
> I haven't contributed in this space for quite some time so I defer to
> more active contributors on this.
>
> If it is true that zsmalloc has no/negligible deficiencies compared to
> zbud, it seems reasonable.
Zsmalloc has been the default allocator and is widely used, I am unaware
of any zbud users in prod settings.
> > but at the cost of using ~32% more memory
>
> I do push back here as this % could be highly variable depending on
> the compressibility of the data.
100% agreed, this is just an example from this specific testing
scenario.
> If the average compressibility is ~50%, zbud should be very memory efficient.
>
> If the average compressibility is very high or very low, it is less
> memory efficient.
That being said, the average compression ratio hovers around 30% for
workloads I am familiar with. I think I have seen similar ratios from
others as well but I will let others chime in.
next prev parent reply other threads:[~2025-01-28 16:45 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-27 23:58 Yosry Ahmed
2025-01-28 10:14 ` Johannes Weiner
2025-01-28 15:27 ` Yosry Ahmed
2025-01-28 10:21 ` Vlastimil Babka
2025-01-28 15:30 ` Yosry Ahmed
2025-01-28 16:04 ` Seth Jennings
2025-01-28 16:45 ` Yosry Ahmed [this message]
2025-01-28 10:29 ` Vitaly Wool
2025-01-28 15:35 ` Yosry Ahmed
2025-01-28 16:57 ` Shakeel Butt
2025-01-28 18:09 ` Nhat Pham
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=Z5kJpCtpfH3bJrbE@google.com \
--to=yosry.ahmed@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=chengming.zhou@linux.dev \
--cc=chenhuacai@kernel.org \
--cc=ddstreet@ieee.org \
--cc=hannes@cmpxchg.org \
--cc=kernel@xen0n.name \
--cc=linmiaohe@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=loongarch@lists.linux.dev \
--cc=nphamcs@gmail.com \
--cc=sjenning@redhat.com \
--cc=vbabka@suse.cz \
--cc=vitaly.wool@konsulko.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