Re: [PATCH v2 1/2] mm/zsmalloc: change back to per-size_class lock

Sergey Senozhatsky
2024-06-24T08:56:44Z

On (24/06/21 15:15), Chengming Zhou wrote:
> This patch is almost the revert of the commit c0547d0b6a4b ("zsmalloc:
> consolidate zs_pool's migrate_lock and size_class's locks"), which
> changed to use a global pool->lock instead of per-size_class lock and
> pool->migrate_lock, was preparation for suppporting reclaim in zsmalloc.
> Then reclaim in zsmalloc had been dropped in favor of LRU reclaim in
> zswap.
>
> In theory, per-size_class is more fine-grained than the pool->lock,
> since a pool can have many size_classes. As for the additional
> pool->migrate_lock, only free() and map() need to grab it to access
> stable handle to get zspage, and only in read lock mode.
>
> Signed-off-by: Chengming Zhou <chengming.zhou@linux.dev>

Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>