linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <senozhatsky@chromium.org>
To: Kenny Cheng <chao.shun.cheng.tw@gmail.com>
Cc: minchan@kernel.org, senozhatsky@chromium.org, linux-mm@kvack.org,
	 linux-kernel@vger.kernel.org, c.s.cheng@realtek.com,
	Andrew Morton <akpm@linux-foundation.org>,
	 Yosry Ahmed <yosry.ahmed@linux.dev>
Subject: Re: [PATCH v2] zsmalloc: Fix address alignment in zspage for performance improvement
Date: Wed, 29 Jan 2025 20:45:46 +0900	[thread overview]
Message-ID: <mqv5dquv3qud3dqmyxzf2kvq7mydjszg6rja2o2w2oa46uvjm2@mrazizdfg73r> (raw)
In-Reply-To: <20250129082825.3760555-1-chao.shun.cheng.tw@gmail.com>

Cc-ing Andrew and Yosry

On (25/01/29 16:28), Kenny Cheng wrote:
> The zspage consists of multiple objects, each containing a "link struct"
> to connect to the next object. The "link struct" is placed at the
> beginning of each object. On a 32-bit system, the size of the "link
> struct" is 4 bytes, which means the address returned by `zs_map_object`
> is always 4-byte aligned.

Sorry, you picked a rather unlucky time to patch zsmalloc, as it
goes through some intrusive changes.  We need to stabilize those
changes first.

> For better performance, zram compression/decompression is offloaded to
> hardware designed by the IC vendor. For example, Realtek's hardware
> requires 16-byte alignment. However, due to the 4-byte alignment,
> a `memcpy` operation is needed to move data from the 4-byte aligned
> address to the 16-byte aligned address, which negatively impacts zram
> performance.

Hmm, I don't know.  If we change zsmalloc to make some H/W happy, how
do we make sure that something that is good for Realtek is not "bad"
for some other H/W?

I'm very unsure about having "vendor-specific" (by the way, is that
out-of-tree compression/decompression driver?) changes in zsmalloc.


  reply	other threads:[~2025-01-29 11:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-29  8:28 Kenny Cheng
2025-01-29 11:45 ` Sergey Senozhatsky [this message]
2025-01-29 13:17   ` Kenny Cheng

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=mqv5dquv3qud3dqmyxzf2kvq7mydjszg6rja2o2w2oa46uvjm2@mrazizdfg73r \
    --to=senozhatsky@chromium.org \
    --cc=akpm@linux-foundation.org \
    --cc=c.s.cheng@realtek.com \
    --cc=chao.shun.cheng.tw@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan@kernel.org \
    --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