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 v2] mm: add zblock allocator
Date: Sat, 05 Apr 2025 01:56:28 +0200	[thread overview]
Message-ID: <1743810988579.7.125720@webmail-backend-production-7b88b644bb-5mmj8> (raw)
In-Reply-To: <20250404200321.GB373778@cmpxchg.org>

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

Hello Johannes,

Den fredag 4 april 2025 kl. 22:03:21 +02:00, skrev Johannes Weiner <hannes@cmpxchg.org>:
> Hello Vitaly,
>
> On Fri, Apr 04, 2025 at 09:28:13PM +0200, Vitaly Wool wrote:
>> zblock is a special purpose allocator for storing compressed pages.
>> It stores integer number of compressed objects per its block. These
>> blocks consist of several physical pages (2**n, i. e. 1/2/4/8).
>>
>> With zblock, it is possible to densely arrange objects of various sizes
>> resulting in low internal fragmentation. Also this allocator tries to
>> fill incomplete blocks instead of adding new ones, in many cases
>> providing a compression ratio substantially higher than z3fold and zbud
>> (though lower than zmalloc's).
>
> Do you have zswap/zswapped meminfo metrics from these tests?

Yep, and those look somewhat similar:
- zblock:
Zswap: 234128 kB
Zswapped: 733216 kB

- zsmalloc:
Zswap: 286080 kB
Zswapped: 774688 kB

<snip>
>> Since zswap is used starting from minute 21, this gives 9% in average in
>> advantage for zblock.
>
> This might be the linker step swapping out source files that are no
> longer needed. Do you have metrics for zswpout and zswpin as well?

I don't think so, the logs show that the compilation is ongoing. Then again, we're just running out of RAM at that point.
Regarding the zswpin/zswpout, zswpin numbers are marginal with the compilation test and zswpout numbers are slightly bigger for zsmalloc (average ~50k vs ~49k).

The numbers for the stress-ng test (stress-ng --vm 4 --vm-bytes 8G --vm-keep --timeout 10m --metrics-brief) are roughly the same:

- zblock: zswpin 9870143 zswpout 10642176
- zsmalloc: zswpin 10642941 zswpout 10432625

<snip>
> My concern with this allocator, and the other alternatives to zsmalloc
> before, is the following:
>
> You might be faster at allocating objects. But if storage density is
> worse, it means you have to zswap more pages to meet the same incoming
> allocation demand. That means more object allocations and more
> compression, and often a higher rate of refaults and decompressions.

I understand. It looks like the storage density is comparable, and for 16K pages zblock may even be doing a better job, see above.

~Vitaly



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

  reply	other threads:[~2025-04-04 23:56 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-04 19:28 Vitaly Wool
2025-04-04 20:03 ` Johannes Weiner
2025-04-04 23:56   ` Vitaly [this message]
2025-04-06  7:53     ` Igor Belousov
2025-04-07  9:00       ` Igor Belousov
2025-04-07 15:51         ` Nhat Pham
2025-04-07 16:44           ` Igor Belousov
2025-04-07 17:00             ` Nhat Pham
2025-04-08  9:20               ` Igor Belousov
2025-04-08 19:55                 ` Johannes Weiner
2025-04-08 21:11                   ` Nhat Pham
2025-04-08 21:38                   ` Vitaly Wool
2025-04-08 22:05                     ` Nhat Pham
2025-04-08 23:12                       ` Vitaly Wool
2025-04-09 17:59                   ` Igor Belousov
2025-04-10  7:02                     ` Igor Belousov
2025-04-07 15:54 ` Johannes Weiner
2025-04-07 18:26   ` Vitaly Wool

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=1743810988579.7.125720@webmail-backend-production-7b88b644bb-5mmj8 \
    --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