From: Nhat Pham <nphamcs@gmail.com>
To: Yosry Ahmed <yosry.ahmed@linux.dev>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Johannes Weiner <hannes@cmpxchg.org>,
Chengming Zhou <chengming.zhou@linux.dev>,
Minchan Kim <minchan@kernel.org>,
Sergey Senozhatsky <senozhatsky@chromium.org>,
Herbert Xu <herbert@gondor.apana.org.au>,
Thomas Gleixner <tglx@linutronix.de>,
Peter Zijlstra <peterz@infradead.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH mm-unstable 2/5] mm: zswap: Use object read/write APIs instead of object mapping APIs
Date: Wed, 5 Mar 2025 09:35:16 -0800 [thread overview]
Message-ID: <CAKEwX=OSKa34Kg2ukzCMpUWiRGgonTHn3pON4LdfJvtexNgu=A@mail.gmail.com> (raw)
In-Reply-To: <20250305061134.4105762-3-yosry.ahmed@linux.dev>
On Tue, Mar 4, 2025 at 10:11 PM Yosry Ahmed <yosry.ahmed@linux.dev> wrote:
>
> Use the new object read/write APIs instead of mapping APIs.
>
> On compress side, zpool_obj_write() is more concise and provides exactly
> what zswap needs to write the compressed object to the zpool, instead of
> map->copy->unmap.
>
> On the decompress side, zpool_obj_read_begin() is sleepable, which
> allows avoiding the memcpy() for zsmalloc and slightly simplifying the
> code by:
> - Avoiding checking if the zpool driver is sleepable, reducing special
> cases and shrinking the huge comment.
> - Having a single zpool_obj_read_end() call rather than multiple
> conditional zpool_unmap_handle() calls.
>
> The !virt_addr_valid() case can be removed in the future if the crypto
> API supports kmap addresses or by using kmap_to_page(), completely
> eliminating the memcpy() path in zswap_decompress(). This a step toward
> that. In that spirit, opportunistically make the comment more specific
> about the kmap case instead of generic non-linear addresses. This is the
> only case that needs to be handled in practice, and the generic comment
> makes it seem like a bigger problem that it actually is.
>
> Signed-off-by: Yosry Ahmed <yosry.ahmed@linux.dev>
Acked-by: Nhat Pham <nphamcs@gmail.com>
next prev parent reply other threads:[~2025-03-05 18:53 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20250305061134.4105762-1-yosry.ahmed@linux.dev>
[not found] ` <20250305061134.4105762-2-yosry.ahmed@linux.dev>
2025-03-05 8:18 ` [PATCH mm-unstable 1/5] mm: zpool: Add interfaces for object read/write APIs Sergey Senozhatsky
2025-03-05 14:43 ` Johannes Weiner
2025-03-05 17:32 ` Nhat Pham
2025-03-05 8:18 ` [PATCH mm-unstable 0/5] Switch zswap to " Sergey Senozhatsky
[not found] ` <20250305061134.4105762-4-yosry.ahmed@linux.dev>
2025-03-05 8:17 ` [PATCH mm-unstable 3/5] mm: zpool: Remove object mapping APIs Sergey Senozhatsky
2025-03-05 14:49 ` Johannes Weiner
2025-03-05 17:37 ` Nhat Pham
2025-03-06 1:48 ` Herbert Xu
2025-03-06 4:19 ` Herbert Xu
2025-03-06 16:55 ` Yosry Ahmed
2025-03-07 2:38 ` Herbert Xu
2025-03-07 5:19 ` Sergey Senozhatsky
2025-03-06 14:15 ` Johannes Weiner
[not found] ` <20250305061134.4105762-6-yosry.ahmed@linux.dev>
2025-03-05 8:14 ` [PATCH mm-unstable 5/5] mm: zpool: Remove zpool_malloc_support_movable() Sergey Senozhatsky
2025-03-05 14:53 ` Johannes Weiner
2025-03-05 17:05 ` Nhat Pham
[not found] ` <20250305061134.4105762-3-yosry.ahmed@linux.dev>
2025-03-05 14:48 ` [PATCH mm-unstable 2/5] mm: zswap: Use object read/write APIs instead of object mapping APIs Johannes Weiner
2025-03-05 17:35 ` Nhat Pham [this message]
[not found] ` <20250305061134.4105762-5-yosry.ahmed@linux.dev>
2025-03-05 8:16 ` [PATCH mm-unstable 4/5] mm: zsmalloc: Remove object mapping APIs and per-CPU map areas Sergey Senozhatsky
2025-03-05 14:51 ` Johannes Weiner
2025-03-05 17:39 ` Nhat Pham
2025-03-05 18:57 ` 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='CAKEwX=OSKa34Kg2ukzCMpUWiRGgonTHn3pON4LdfJvtexNgu=A@mail.gmail.com' \
--to=nphamcs@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=chengming.zhou@linux.dev \
--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=peterz@infradead.org \
--cc=senozhatsky@chromium.org \
--cc=tglx@linutronix.de \
--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