linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Vitaly" <vitaly.wool@konsulko.se>
To: "Johannes Weiner" <hannes@cmpxchg.org>
Cc: <linux-mm@kvack.org>, <akpm@linux-foundation.org>,
	<linux-kernel@vger.kernel.org>, "Nhat Pham" <nphamcs@gmail.com>,
	"Shakeel Butt" <shakeel.butt@linux.dev>,
	"Igor Belousov" <igor.b@beldev.am>
Subject: Re: [PATCH v4] mm: add zblock allocator
Date: Wed, 16 Apr 2025 22:10:23 +0200	[thread overview]
Message-ID: <1744834223790.7.2308@webmail-backend-production-58ff969799-kbd7f> (raw)
In-Reply-To: <20250416120912.GC741145@cmpxchg.org>

[-- Attachment #1: Type: text/plain, Size: 2805 bytes --]


On Wednesday, April 16, 2025 at 2:09:12 pm +02:00, Johannes Weiner <hannes@cmpxchg.org> wrote:

>> zblock is also in most cases superior to zsmalloc with regard to
>> average performance and worst execution times, thus allowing for better
>> response time and real-time characteristics of the whole system.

>> Is there a reason not to use this allocation scheme in zsmalloc then?

Introducing such a scheme in zsmalloc is theoretically possible but it appears to be more complicated than implementing it from scratch, which is exactly what was done.

> I'm curious what others think, but I'm still not convinced a second
> allocator makes sense. It's maintenance overhead, a permanent struggle
> to match feature parity, and it fragments development and testing base.

> Not long ago several slab allocators were removed for those
> reasons. Likewise, we just deleted zbud and z3fold because they didn't
> get any attention and bitrotted, but not before years of inflicting
> pain through the zpool interface, users accidentally making very
> suboptimal choices, reporting the same bugs over and over again etc.

I'm not sure what pain you are talking about. There were reasons why z3fold and zbud existed. z3fold and zbud were the ones that supported page reclaim, zsmalloc wasn't quite usable with zswap until recently. When we did z3fold it was outperforming zsmalloc.

With that said, I didn't object to removing z3fold because I did understand that it made no sense to keep it at that point.

> I also don't buy the fragmentation argument. Even if you are better at
> packing during allocation time (although, citation needed), the
> workload can unmap swap pages such that they leave partial blocks
> behind indefinitely if you don't have block compaction.

We published Zswap/Zswapped values for zblock/zsmalloc after stress loads and those were on par, basically.

> Then there is the migration support, which you said is planned, but
> which would presumably require the same indirection between handle and
> the backing pages that zsmalloc has. How much will this eat into the
> performance advantage?


I don't think that will be necessary. We're working on supporting GFP_MOVABLE and minimising high order allocations
> I'd much rather you'd focus on making zsmalloc better. Improve the
> packing scheme, make expensive features optional/configurable etc.
> That would be easier on developers and users alike.

zblock's source code is almost 5x smaller in size than zsmalloc's and yet zblock works better in many cases with just a few bottlenecks. Why would you mind that we'd focus on making zblock better instead and possibly retire zsmalloc when that mission is accomplished, just like we retired z3fold a while ago?

Best regards,

Vitaly

[-- Attachment #2.1: Type: text/html, Size: 3520 bytes --]

  reply	other threads:[~2025-04-16 20:10 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-12 15:42 Vitaly Wool
2025-04-12 19:25 ` Igor Belousov
2025-04-16 12:09 ` Johannes Weiner
2025-04-16 20:10   ` Vitaly [this message]
2025-04-17 14:16     ` Johannes Weiner
2025-04-18  7:43       ` Vitaly Wool
2025-04-18 10:52   ` David Hildenbrand
2025-04-18 10:56     ` Vitaly Wool
2025-04-18 11:03       ` David Hildenbrand
2025-04-22 10:46 ` Yosry Ahmed
2025-04-23 19:53   ` Vitaly Wool
2025-04-30 12:27     ` Yosry Ahmed
2025-05-01 12:41       ` Vitaly Wool
2025-05-01 23:43         ` Sergey Senozhatsky
2025-05-06 13:04         ` Yosry Ahmed
2025-06-11 17:11           ` Vitaly Wool
2025-05-01 23:49     ` Sergey Senozhatsky
2025-05-03  8:27       ` Vitaly
2025-05-04  9:26 ` Andrew Morton
2025-07-20  2:56 ` Andrew Morton

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=1744834223790.7.2308@webmail-backend-production-58ff969799-kbd7f \
    --to=vitaly.wool@konsulko.se \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=igor.b@beldev.am \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nphamcs@gmail.com \
    --cc=shakeel.butt@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