summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorYosry Ahmed <yosry.ahmed@linux.dev>2026-01-07 14:21:45 +0900
committerAndrew Morton <akpm@linux-foundation.org>2026-01-26 20:02:26 -0800
commit19c4707b535a31dc8a6009afc249f36db7011ac3 (patch)
tree6e9974b0e5b47cd46a34f64cb50f1f5dffaa891d /include/linux
parent0be909f114c4e82a4fe5964851af1ab8889dc76c (diff)
zsmalloc: simplify read begin/end logic
zs_obj_read_begin() currently maps or copies the compressed object with the prefix handle for !ZsHugePage case. Make the logic clearer and more efficient 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. Link: https://lkml.kernel.org/r/20260107052145.3586917-2-senozhatsky@chromium.org Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org> Co-developed-by: Yosry Ahmed <yosry.ahmed@linux.dev> Signed-off-by: Yosry Ahmed <yosry.ahmed@linux.dev> Cc: Brian Geffon <bgeffon@google.com> Cc: Chengming Zhou <chengming.zhou@linux.dev> Cc: Jens Axboe <axboe@kernel.dk> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Minchan Kim <minchan@kernel.org> Cc: Nhat Pham <nphamcs@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions