Re: [PATCH RESEND 2/3] mm/zsmalloc: remove migrate_write_lock_nested()

Sergey Senozhatsky
2024-02-23T05:56:32Z

On (24/02/20 11:36), Chengming Zhou wrote:
> From: Chengming Zhou <zhouchengming@bytedance.com>
>
> The migrate write lock is to protect the race between zspage migration
> and zspage objects' map users.
>
> We only need to lock out the map users of src zspage, not dst zspage,
> which is safe to map by users concurrently, since we only need to do
> obj_malloc() from dst zspage.
>
> So we can remove the migrate_write_lock_nested() use case.
>
> As we are here, cleanup the __zs_compact() by moving putback_zspage()
> outside of migrate_write_unlock since we hold pool lock, no malloc or
> free users can come in.
>
> Signed-off-by: Chengming Zhou <zhouchengming@bytedance.com>

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