From: Sergey Senozhatsky <senozhatsky@chromium.org>
To: Yosry Ahmed <yosry.ahmed@linux.dev>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>,
Andrew Morton <akpm@linux-foundation.org>,
Minchan Kim <minchan@kernel.org>, Nhat Pham <nphamcs@gmail.com>,
Johannes Weiner <hannes@cmpxchg.org>,
Brian Geffon <bgeffon@google.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Herbert Xu <herbert@gondor.apana.org.au>
Subject: Re: [PATCH] zsmalloc: introduce SG-list based object read API
Date: Sat, 17 Jan 2026 12:48:53 +0900 [thread overview]
Message-ID: <gu5dej7cnw47xr7abuuksqocwt7k25tqad55t3jqwgl2pa4mlr@2kdf5fpy7cbj> (raw)
In-Reply-To: <f24061e372edefd7b70490effd18b646c72ff9fa@linux.dev>
On (26/01/17 03:23), Yosry Ahmed wrote:
> > > There is a lot of duplication between this and zs_obj_read_begin(). I
> > > wanted to create a common helper for them both that returns the zpdesc
> > > and offset, but we cannot do the same on the read end side as the unlock
> > > needs to happen after kunmap() in zs_obj_read_end().
> > >
> > > Putting parts of this code in helpers makes it a bit obscure due to the
> > > locking rules :/
> > >
> > > I wonder if we can drop zs_obj_read_*() and move the spanning logic into
> > > zram. Looking at zram code, seems like read_from_zspool_raw() and
> > > read_incompressible_page() just copy the return address, so I think they
> > > can trivially move to using the SG list helpers and
> > > memcpy_from_sglist().
> > >
> > > The only non-trivial caller is read_compressed_page(), because it passes
> > > the compressed object to zcomp. So I think we only need to handle the
> > > linearization there, something like this (completely untested):
> > >
> > So I was thinking about leaving things as they currently are for this
> > dev cycle, because both zram and zsmalloc have enough of new code queued
> > up. If you don't mind let's remove memcpy() API and convert zram during
> > next cycle (after the upcoming merge window).
>
> Sure. I think we can do all of it in a single series for the next cycle.
> Add SG interfaces, convert zswap and zram, and remove the old interfaces.
Technically zswap doesn't have to wait for zram, and you can convert
it now, but I don't have any objections to doing both in one series
for the next cycle, sounds good to me.
next prev parent reply other threads:[~2026-01-17 3:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-13 3:46 Sergey Senozhatsky
2026-01-13 4:30 ` Herbert Xu
2026-01-16 19:53 ` Yosry Ahmed
2026-01-17 2:39 ` Sergey Senozhatsky
2026-01-17 3:23 ` Yosry Ahmed
2026-01-17 3:48 ` Sergey Senozhatsky [this message]
2026-02-03 23:14 ` Nhat Pham
2026-02-03 23:37 ` 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=gu5dej7cnw47xr7abuuksqocwt7k25tqad55t3jqwgl2pa4mlr@2kdf5fpy7cbj \
--to=senozhatsky@chromium.org \
--cc=akpm@linux-foundation.org \
--cc=bgeffon@google.com \
--cc=hannes@cmpxchg.org \
--cc=herbert@gondor.apana.org.au \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan@kernel.org \
--cc=nphamcs@gmail.com \
--cc=yosry.ahmed@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