linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Nhat Pham <nphamcs@gmail.com>
To: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Yosry Ahmed <yosry.ahmed@linux.dev>,
	 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 1/2] zsmalloc: use actual object size to detect spans
Date: Wed, 14 Jan 2026 13:17:57 +0900	[thread overview]
Message-ID: <CAKEwX=POodPuBkKkQvgt7R7cbjJ1z5CJ=sKLAA5uWsEX7OyrgA@mail.gmail.com> (raw)
In-Reply-To: <20260107052145.3586917-1-senozhatsky@chromium.org>

On Wed, Jan 7, 2026 at 2:24 PM Sergey Senozhatsky
<senozhatsky@chromium.org> wrote:
>
> Using class->size to detect spanning objects is not entirely correct,
> because some size classes can hold a range of object sizes of up to
> class->size bytes in length, due to size-classes merge.  Such classes
> use padding for cases when actually written objects are smaller than
> class->size.  zs_obj_read_begin() can incorrectly hit the slow path
> and perform memcpy of such objects, basically copying padding bytes.
> Instead of class->size zs_obj_read_begin() should use the actual
> compressed object length (both zram and zswap know it) so that it can
> correctly handle situations when a written object is small enough to
> fit into the first physical page.
>
> Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
> ---
>

LGTM!

Reviewed-by: Nhat Pham <nphamcs@gmail.com>


      parent reply	other threads:[~2026-01-14  4:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-07  5:21 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
2026-01-07 18:57 ` [PATCHv2 1/2] zsmalloc: use actual object size to detect spans Yosry Ahmed
2026-01-14  4:17 ` Nhat Pham [this message]

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=POodPuBkKkQvgt7R7cbjJ1z5CJ=sKLAA5uWsEX7OyrgA@mail.gmail.com' \
    --to=nphamcs@gmail.com \
    --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=senozhatsky@chromium.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