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>,
Johannes Weiner <hannes@cmpxchg.org>,
Nhat Pham <nphamcs@gmail.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 5/6] zsmalloc: introduce handle mapping API
Date: Wed, 29 Jan 2025 14:40:43 +0900 [thread overview]
Message-ID: <5iotloij4kc6cjugszxh2bpalszwcptwkvqkwigbpehqql7m5q@kylewcf3d5ga> (raw)
In-Reply-To: <Z5g0gITP8psSdqwj@google.com>
On (25/01/28 01:36), Yosry Ahmed wrote:
> zs_obj_read_start(.., buf)
> {
> if (contained in one page)
> return kmapped obj
> else
> memcpy to buf
> return buf
> }
>
> zs_obj_read_end(.., buf)
> {
> if (container in one page)
> kunmap
> }
So it seems we can optimize things a little further by avoiding more
memcpy() calls. Namely, for WO directions [on objects that span two
pages] the caller first memcpy() data to a provided temp buffer (per-CPU
buffer at this moment) and then during zs_unmap() memcpy() from that temp
buffer to physical pages that object spans accross. We can skip this memcpy()
and instead write to physical pages straight from the compression buffer.
I'll post an updated series shortly.
next prev parent reply other threads:[~2025-01-29 5:40 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-27 7:59 [RFC PATCH 0/6] zsmalloc: make zsmalloc preemptible Sergey Senozhatsky
2025-01-27 7:59 ` [RFC PATCH 1/6] zram: deffer slot free notification Sergey Senozhatsky
2025-01-27 7:59 ` [RFC PATCH 2/6] zsmalloc: make zspage lock preemptible Sergey Senozhatsky
2025-01-27 20:23 ` Uros Bizjak
2025-01-28 0:29 ` Sergey Senozhatsky
2025-01-27 7:59 ` [RFC PATCH 3/6] zsmalloc: convert to sleepable pool lock Sergey Senozhatsky
2025-01-27 7:59 ` [RFC PATCH 4/6] zsmalloc: make class lock sleepable Sergey Senozhatsky
2025-01-27 7:59 ` [RFC PATCH 5/6] zsmalloc: introduce handle mapping API Sergey Senozhatsky
2025-01-27 21:26 ` Yosry Ahmed
2025-01-28 0:37 ` Sergey Senozhatsky
2025-01-28 0:49 ` Yosry Ahmed
2025-01-28 1:13 ` Sergey Senozhatsky
2025-01-27 21:58 ` Yosry Ahmed
2025-01-28 0:59 ` Sergey Senozhatsky
2025-01-28 1:36 ` Yosry Ahmed
2025-01-28 5:29 ` Sergey Senozhatsky
2025-01-28 9:38 ` Sergey Senozhatsky
2025-01-28 17:21 ` Yosry Ahmed
2025-01-29 3:32 ` Sergey Senozhatsky
2025-01-28 11:10 ` Sergey Senozhatsky
2025-01-28 17:22 ` Yosry Ahmed
2025-01-28 23:01 ` Sergey Senozhatsky
2025-01-29 5:40 ` Sergey Senozhatsky [this message]
2025-01-27 7:59 ` [RFC PATCH 6/6] zram: switch over to zshandle " Sergey Senozhatsky
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=5iotloij4kc6cjugszxh2bpalszwcptwkvqkwigbpehqql7m5q@kylewcf3d5ga \
--to=senozhatsky@chromium.org \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--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