]> www.infradead.org Git - users/dwmw2/linux.git/commit
mm/zsmalloc: don't need to reserve LSB in handle
authorChengming Zhou <chengming.zhou@linux.dev>
Wed, 28 Feb 2024 02:38:54 +0000 (02:38 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 5 Mar 2024 01:01:28 +0000 (17:01 -0800)
commit26e93839d6d9d9c6169fa7559b8d1577e42d4ace
tree8e900da028b540bbd953b1061d99cb02141755ab
parent6c1b748ebf27befffec83b77ca1960bf70ed6ac9
mm/zsmalloc: don't need to reserve LSB in handle

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.

Link: https://lkml.kernel.org/r/20240228023854.3511239-1-chengming.zhou@linux.dev
Signed-off-by: Chengming Zhou <chengming.zhou@linux.dev>
Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Nhat Pham <nphamcs@gmail.com>
Cc: Yosry Ahmed <yosryahmed@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/zsmalloc.c