linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Ananda Badmaev <a.badmaev@clicknet.pro>
To: Yosry Ahmed <yosryahmed@google.com>
Cc: Linux-MM <linux-mm@kvack.org>, vitaly.wool@konsulko.com
Subject: Re: [PATCH v5] mm: add zblock - new allocator for use via zpool API
Date: Thu, 29 Sep 2022 08:24:55 +0300	[thread overview]
Message-ID: <dedad1ba-5e87-bc24-1cd8-c25e2d8cd9cb@clicknet.pro> (raw)
In-Reply-To: <CAJD7tkaw67B9xj-YXQcOCi8z=CJ6EGD+ou1fP1QyyokdJB+f2Q@mail.gmail.com>

28.09.2022 21:37, Yosry Ahmed пишет:
> On Wed, Sep 28, 2022 at 1:06 AM ananda <a.badmaev@clicknet.pro> wrote:
>>
>> From: Ananda <a.badmaev@clicknet.pro>
>>
>>      Zblock stores integer number of compressed objects per zblock block.
>> These blocks consist of several physical pages (1/2/4/8) and are arranged
>> in linked lists.
>>      The range from 0 to PAGE_SIZE is divided into the number of intervals
>> corresponding to the number of lists and each list only operates objects
>> of size from its interval. Thus the block lists are isolated from each
>> other, which makes it possible to simultaneously perform actions with
>> several objects from different lists.
>>      Blocks make it 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 thus in many cases providing
>> a compression ratio substantially higher than z3fold and zbud.
>>      Zblock does not require MMU and also is superior to zsmalloc with
>> regard to the worst execution times, thus allowing for better response time
>> and real-time characteristics of the whole system.
>>
> 
> It seems to me, and I can be wrong, that there is some overlap in
> design and goals between this zpool backend and zsmalloc. They both
> try to avoid internal fragmentation by avoiding the static slots used
> by zbud and z3fold, and instead pack compressed pages more
> dynamically. They both have some sort of concurrency handling
> (separate block lists in zblock vs. classes in zsmalloc). A key
> difference is that zsmalloc avoids higher order allocations (at least
> based on its docs), and instead allows compressed pages to span across
> 0-order page boundaries.

You are right.

> The key differences I see here (based on this commit message and
> zsmalloc docs) are:
> a) Blocks in zblock can consist of higher order pages.
> b) Compressed pages in zsmalloc can span page boundaries (I am
> assuming this isn't the case for zblock).
> 
> It appears to me that if zblock has better performance than zsmalloc,
> it can be because pages in zblock are physically contiguous vs. the
> 0-order pages in zsmalloc (TLB misses, cache misses, etc). Is my
> assumption correct?
> 

Yes.

> If yes, would it be better to implement those changes as some tunable
> extension to zsmalloc? It would make it easier if we have overall less
> zpool backends, and also easier for current users of zsmalloc to
> experiment with these changes.
> 

Sounds reasonable, but I'm afraid in this case zsmalloc code will become 
overloaded also there might be problems with keeping zblock simplicity.


  reply	other threads:[~2022-09-29  5:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-28  8:01 ananda
2022-09-28 17:29 ` Matthew Wilcox
2022-09-29  5:01   ` Ananda Badmaev
2022-09-28 18:37 ` Yosry Ahmed
2022-09-29  5:24   ` Ananda Badmaev [this message]
2022-09-29  6:55     ` Vitaly Wool
2022-09-29  6:55   ` Vitaly Wool
2022-09-29  7:58     ` Yosry Ahmed
2022-09-29  8:53       ` Vitaly Wool
2022-09-29 18:28         ` Yosry Ahmed

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=dedad1ba-5e87-bc24-1cd8-c25e2d8cd9cb@clicknet.pro \
    --to=a.badmaev@clicknet.pro \
    --cc=linux-mm@kvack.org \
    --cc=vitaly.wool@konsulko.com \
    --cc=yosryahmed@google.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