From: Yosry Ahmed <yosry.ahmed@linux.dev>
To: Vitaly Wool <vitaly.wool@konsulko.se>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>,
Vlastimil Babka <vbabka@suse.cz>,
hannes@cmpxchg.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>,
Christoph Hellwig <hch@infradead.org>
Subject: Re: [PATCH 0/3] mm: remove zpool
Date: Mon, 15 Sep 2025 19:37:00 +0000 [thread overview]
Message-ID: <fui4gqm6pealaxooz3xv3dnnqxscefyvhw5bhntedwh4tgjvdq@ootmbuoc3dpa> (raw)
In-Reply-To: <98B3AFB0-EBD5-4779-A5DB-FFA6717E83C3@konsulko.se>
On Sat, Sep 13, 2025 at 03:55:16PM +0200, Vitaly Wool wrote:
>
>
> > On Sep 9, 2025, at 10:12 PM, Yosry Ahmed <yosry.ahmed@linux.dev> wrote:
> >
> > On Mon, Sep 08, 2025 at 09:18:01PM +0900, Sergey Senozhatsky wrote:
> >> On (25/09/06 14:25), Sergey Senozhatsky wrote:
> >>> On (25/09/05 19:57), Yosry Ahmed wrote:
> >>>> I think Android uses zram+zsmalloc with 16K pages. Perhaps Sergey could
> >>>> confirm.
> >>>
> >>> I'm not working on android directly,
> >>>
> >>> I can confirm that android uses zram+zsmalloc. As of 16K pages, there
> >>> was a way to toggle 16k pages on android (via system settings), I don't
> >>> know if this is the default now.
> >>
> >> While I don't know what zsmalloc struggles Vitaly is referring to in
> >> particular, off the top of my head, zsmalloc does memcpy()'s for objects
> >> that span multiple pages, when zsmalloc kmap()'s both physical pages and
> >> memcpy()'s chunks of the object into a provided buffer. With 16K pages
> >> we can have rather larger compressed objects, so those memcpy() are likely
> >> more visible. Attacking this would be a good idea, I guess.
> >
> > Yeah I personally think attacking whatever problems zsmalloc has with
> > 16K pages is the way to go.
>
> Well, there is a way out for 16+K pages, that being:
> * restricting zsmalloc to not have objects spanning across 2 pages
> * reworking size_classes based allocation to have uneven steps
> * as a result of the above, organising binary search for the right size object
>
> This will effectively turn zsmalloc into zblock, with some extra cruft that makes it far less comprehensible.
I think the way to go would be this, identifying problems with 16K on
zsmalloc, and addressing them one by one in a data-driven way.
I don't believe there will be opposition to this, or even adding more
tunables / config options to alter zsmalloc's behavior based on the
environment. If there's indeed extra cruft, we can either clean it up or
hide it behind config/tunabels so that it's only enabled when needed.
>
> Another option would be to leave zsmalloc do its job on 4K pages and use zblock for bigger pages. But it is not possible at the moment because zpool api has been removed. Thats’s why I NACK’ed the zpool removal, at least until we have a replacement for it ready.
I think having a separate allocator that's better for each page size is
not a good option tbh.
next prev parent reply other threads:[~2025-09-15 19:37 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-29 16:15 Johannes Weiner
2025-08-29 16:15 ` [PATCH 1/3] mm: zswap: interact directly with zsmalloc Johannes Weiner
2025-09-05 18:53 ` Yosry Ahmed
2025-09-09 15:01 ` Johannes Weiner
2025-09-09 20:10 ` Yosry Ahmed
2025-09-10 13:42 ` Johannes Weiner
2025-09-11 14:30 ` Yosry Ahmed
2025-09-15 15:36 ` Johannes Weiner
2025-09-15 19:33 ` Yosry Ahmed
2025-08-29 16:15 ` [PATCH 2/3] mm: remove unused zpool layer Johannes Weiner
2025-08-29 19:07 ` SeongJae Park
2025-09-09 15:13 ` Johannes Weiner
2025-09-10 3:14 ` SeongJae Park
2025-09-05 18:58 ` Yosry Ahmed
2025-09-09 15:16 ` Johannes Weiner
2025-09-09 20:08 ` Yosry Ahmed
2025-09-09 20:09 ` Yosry Ahmed
2025-09-10 13:46 ` Johannes Weiner
2025-08-29 16:15 ` [PATCH 3/3] mm: zpdesc: minor naming and comment corrections Johannes Weiner
2025-09-05 19:05 ` Yosry Ahmed
2025-09-09 15:11 ` Johannes Weiner
2025-09-09 20:08 ` Yosry Ahmed
2025-09-04 9:33 ` [PATCH 0/3] mm: remove zpool Vitaly Wool
2025-09-04 10:13 ` Vlastimil Babka
2025-09-04 11:26 ` David Hildenbrand
2025-09-05 5:36 ` Vitaly Wool
2025-09-04 14:11 ` Vitaly Wool
2025-09-05 7:03 ` Vlastimil Babka
2025-09-05 18:02 ` Nhat Pham
2025-09-05 22:42 ` Vitaly Wool
2025-09-05 19:57 ` Yosry Ahmed
2025-09-06 5:25 ` Sergey Senozhatsky
2025-09-08 12:18 ` Sergey Senozhatsky
2025-09-09 20:12 ` Yosry Ahmed
2025-09-13 13:55 ` Vitaly Wool
2025-09-15 19:37 ` Yosry Ahmed [this message]
2025-09-16 11:16 ` Vitaly Wool
2025-09-16 3:29 ` Sergey Senozhatsky
2025-09-04 23:47 ` Andrew Morton
2025-09-05 5:42 ` Vitaly Wool
2025-09-05 18:30 ` Andrew Morton
2025-09-05 22:20 ` Vitaly Wool
2025-09-04 9:51 ` Vitaly Wool
2025-09-05 17:52 ` Nhat Pham
2025-09-05 19:45 ` Yosry Ahmed
2025-09-05 21:35 ` Nhat Pham
2025-09-09 15:03 ` Johannes Weiner
2025-09-09 20:11 ` 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=fui4gqm6pealaxooz3xv3dnnqxscefyvhw5bhntedwh4tgjvdq@ootmbuoc3dpa \
--to=yosry.ahmed@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=senozhatsky@chromium.org \
--cc=vbabka@suse.cz \
--cc=vitaly.wool@konsulko.se \
/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