linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
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>,
	Nhat Pham <nphamcs@gmail.com>, Minchan Kim <minchan@kernel.org>,
	 Johannes Weiner <hannes@cmpxchg.org>,
	Brian Geffon <bgeffon@google.com>,
	linux-kernel@vger.kernel.org,  linux-mm@kvack.org
Subject: Re: [PATCHv2 2/2] zsmalloc: simplify read begin/end logic
Date: Thu, 8 Jan 2026 10:17:41 +0900	[thread overview]
Message-ID: <se3v2st4cr6vbqgw5y3a5egeq5zrkh5bede2rcheygpdsem5sm@j3k75zxt73ou> (raw)
In-Reply-To: <gl54caplknnljganmswspw3cggoyjxe2n7szvnwhhiyl5y7ynh@tzl2yz7bw725>

On (26/01/07 19:03), Yosry Ahmed wrote:
> On Wed, Jan 07, 2026 at 02:21:45PM +0900, Sergey Senozhatsky wrote:
> > From: Yosry Ahmed <yosry.ahmed@linux.dev>
> 
> While I appreciate this, I think for all intents and purposes this patch
> should be credited to you, it's different from the diff I said as it
> applies on top of your change.
> 
> If you're feeling really generous, I think Suggested-by or
> Co-developed-by + Signed-off-by is sufficient :)

Okey-dokey
Co-developed-by: Yosry Ahmed <yosry.ahmed@linux.dev>

> > When we switched from using class->size (for spans detection)
> > to actual compressed object size, we had to compensate for
> > the fact that class->size implicitly took inlined handle
> > into consideration.  In fact, instead of adjusting the size
> > of compressed object (adding handle offset for non-huge size
> > classes), we can move some lines around and simplify the
> > code: there are already paths in read_begin/end that compensate
> > for inlined object handle offset.
> 
> I think the commit log is not clear in isolation.
> 
> How about something like this:
> 
> zs_obj_read_begin() currently maps or copies the the compressed object
> with the prefix handle for !ZsHugePage case.  Make the logic clearer and
> more officient by moving the offset of the object in the page after the
> prefix handle instead, only copying the actual object and avoiding the
> need to adjust the returned address to account for the prefix.
> 
> Adjust the logic to detect spanning objects in zs_obj_read_end()
> accordingly, slightly simplifying it by avoiding the need to account for
> the handle in both the offset and the object size.

Looks good to me.

Andrew, can we trouble you with commit message update or should I resend?


  reply	other threads:[~2026-01-08  1:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-07  5:21 [PATCHv2 1/2] zsmalloc: use actual object size to detect spans Sergey Senozhatsky
2026-01-07  5:21 ` [PATCHv2 2/2] zsmalloc: simplify read begin/end logic Sergey Senozhatsky
2026-01-07 18:17   ` Andrew Morton
2026-01-08  1:14     ` Sergey Senozhatsky
2026-01-07 19:03   ` Yosry Ahmed
2026-01-08  1:17     ` Sergey Senozhatsky [this message]
2026-01-07 18:57 ` [PATCHv2 1/2] zsmalloc: use actual object size to detect spans 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=se3v2st4cr6vbqgw5y3a5egeq5zrkh5bede2rcheygpdsem5sm@j3k75zxt73ou \
    --to=senozhatsky@chromium.org \
    --cc=akpm@linux-foundation.org \
    --cc=bgeffon@google.com \
    --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