Re: [PATCH v2] mm/zswap: store <PAGE_SIZE compression failed page as-is

From: SeongJae Park
Date: Fri Aug 15 2025 - 20:14:26 EST


On Fri, 15 Aug 2025 16:08:50 -0700 Nhat Pham <nphamcs@xxxxxxxxx> wrote:

> On Fri, Aug 15, 2025 at 3:29 PM Chris Li <chrisl@xxxxxxxxxx> wrote:
> >
> > On Wed, Aug 13, 2025 at 11:20 AM SeongJae Park <sj@xxxxxxxxxx> wrote:
[...]
> > I slept over it a bit. Now I think we should make this a counter of
> > how many uncompressed pages count stored in zswap. Preperbelly as per
> > memcg counter.
>
> Actually, yeah I asked about this counter in a review in an earlier
> version as well, then I completely forgot about it :)
>
>
> > I saw that you implement it as a counter in your V1. Does the zsmalloc
> > already track this information in the zspool class? Having this per
>
> Kinda sorta. If we build the kernel with CONFIG_ZSMALLOC_STAT, we can
> get the number of objects in each size_class.
>
> Each time we read, I believe we have to read every size class though.
> So it's kinda annoying. Whereas here, we can just read an atomic
> counter? :)

Sounds good. So in the next version (v4), I will drop compress_fail. Instead,
I will add two new counters, namely compress_engine_fail and the new atomic
counter, say, stored_uncompressed_pages. Please suggest better names or
correct me if I'm missing some of your points.


Thanks,
SJ

[...]