Re: [PATCH] zsmalloc: use actual object size to detect spans

From: Sergey Senozhatsky

Date: Wed Jan 07 2026 - 02:12:50 EST


A correction:

On (26/01/07 14:30), Sergey Senozhatsky wrote:
> > We increase the offset by 8 bytes (ZS_HANDLE_SIZE), but we still copy 48
> > bytes, even though 48 bytes includes both the object and ZS_HANDLE_SIZE.
> > So we end up copying 8 bytes beyond the end of the object, which puts us
> > in the next page which we should not be copying.
>
> Correct. We increased it twice: off +8 and mem_len +8.
^^ class->size (implicit +8)

I tested your patch as is, w/o applying mine.