From: Vitaly Wool <vitaly.wool@konsulko.se>
To: Nhat Pham <nphamcs@gmail.com>
Cc: 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: Sat, 6 Sep 2025 00:42:37 +0200 [thread overview]
Message-ID: <5f6a8336-3d0e-4fa4-8fc9-08f59f462eac@konsulko.se> (raw)
In-Reply-To: <CAKEwX=MMNSg-QdA2XdBpzhi_d-o9Pv4OOPR5nqrvUVWRdnnpLA@mail.gmail.com>
On 9/5/25 20:02, Nhat Pham wrote:
> On Thu, Sep 4, 2025 at 4:49 PM Vitaly Wool <vitaly.wool@konsulko.se> wrote:
>>
>>
>>
>> On 9/4/25 12:13, Vlastimil Babka wrote:
>>> On 9/4/25 11:33, Vitaly Wool wrote:
>>>>> With zswap using zsmalloc directly, there are no more in-tree users of
>>>>> this code. Remove it.
>>>>>
>>>>> Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
>>>>
>>>> Per the previous discussions, this gets a *NACK* from my side. There is
>>>> hardly anything _technical_ preventing new in-tree users of zpool API.
>>>> zpool API is neutral and well-defined, I don’t see *any* good reason for
>>>> it to be phased out.
>>>
>>> AFAIK it's a policy that unused code should be removed ASAP. And that's the
>>> case for zpool after Patch 1, no? It could be different if another user was
>>> about to be merged (to avoid unnecessary churn), but that doesn't seem the
>>> case for zblock?
>>
>> For the C implementation of zblock, no. But there's another
>> implementation which is in Rust and it's nearing the submission.
>>
>>> My concern would be if the removal breaks any existing installations relying
>>> on zswap. Presumably not as a make oldconfig will produce a config where
>>> nothing important is missing, and existing boot options such as
>>> "zswap.zpool=" or attempts to write to in the init scripts to
>>> "/sys/module/zswap/parameters/zpool" will cause some errors/noise but not
>>> prevent booting correctly?
>>
>> I don't expect heavy breakage but misconfigurations will definitely occur.
>>> I mean if we were paranoid and anticipated somebody would break their
>>> booting if writing to /sys/module/zswap/parameters/zpool failed, we could
>>> keep the file (for a while) and just produce a warning in dmesg that it's
>>> deprecated and does nothing?
>>>
>>> From Patch 1:
>>>
>>>> Note that this does not preclude future improvements and experiments
>>>> with different allocation strategies. Should it become necessary, it's
>>>> possible to provide an alternate implementation for the zsmalloc API,
>>>> selectable at compile time. However, zsmalloc is also rather mature
>>>> and feature rich, with years of widespread production exposure; it's
>>>> encouraged to make incremental improvements rather than fork it.
>>>
>>> With my history of maintaining the slab allocators I can only support this
>>> approach.
>>
>> There was the time when slab was the best option and it was more mature
>> than slub, which is now the best and only option. Thus, the "maturity"
>> point is indeed valid but not being backed by anything else it doesn't
>> weigh too much. Besides, zsmalloc's production exposure from all I know
>> is limited to the 4K page case, and zsmalloc is truly struggling when
>> the system is configured for 16K pages.
>
> That doesn't sound unfixable, if I recall our conversation correctly.
> Perhaps all of this effort is better off being spent fixing zsmalloc's
> inefficiencies :)
Well, there are 2 main issues with zsmalloc on bigger pages as I see it:
1) the granularity in allocations goes down due to the limited number of
zsmalloc classes
2) the idea that an object can span 2 pages on a large page system turns
out to be costly and inefficient.
And if you think about solving these problems you end up with something
zblock like.
>>
>> Things keep changing, and some of the proven solutions may not be a good
>> fit moving forward. While not suggesting that we should have a handful
>> of zpool backends just for the sake of variety, I'd like to emphasize
>> that there are good reasons to have zblock (especially the Rust one),
>> and there are good reasons to keep zsmalloc. That leads to the
>> conclusion that zpool should stay.
>
> IMHO, the needs for multiple allocators do not necessitate the zpool API.
>
> The zpool API is only needed if you want to switch the allocators
> arbitrarily at runtime. This one is a much harder sell.
>
> We can always add zblock, and select the backend via build options.
> Overtime, as zsmalloc improves to acquire zblock's advances, or zblock
> implements the missing features (migratability, compaction, etc.), we
> can unify/remove one of them.
I think migratability is no longer an issue. Compaction will be added
along the way but it isn't a crucial feature for zblock because its
fragmentation is harmless in the sense that temporarily empty slots act
like a cache as opposed to being an unusable free space.
Best regards,
Vitaly
next prev parent reply other threads:[~2025-09-05 22:42 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 [this message]
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
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=5f6a8336-3d0e-4fa4-8fc9-08f59f462eac@konsulko.se \
--to=vitaly.wool@konsulko.se \
--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=nphamcs@gmail.com \
--cc=vbabka@suse.cz \
/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