Re: [PATCH v2] mm/zsmalloc: don't need to reserve LSB in handle

From: Sergey Senozhatsky
Date: Tue Feb 27 2024 - 22:26:49 EST


On (24/02/28 02:38), Chengming Zhou wrote:
> We will save allocated tag in the object header to indicate that it's
> allocated.
>
> handle |= OBJ_ALLOCATED_TAG;
>
> So the object header needs to reserve LSB for this tag bit.
>
> But the handle itself doesn't need to reserve LSB to save tag, since
> it's only used to find the position of object, by (pfn + obj_idx).
> So remove LSB reserve from handle, one more bit can be used as obj_idx.
>
> Signed-off-by: Chengming Zhou <chengming.zhou@xxxxxxxxx>

Reviewed-by: Sergey Senozhatsky <senozhatsky@xxxxxxxxxxxx>