Re: [RFC PATCH 4/7] mm: zswap: remove page reclaim logic from zsmalloc

From: Johannes Weiner
Date: Mon Jun 05 2023 - 11:37:34 EST


On Mon, Jun 05, 2023 at 10:54:16AM +0200, Domenico Cerasuolo wrote:
> @@ -884,14 +842,6 @@ static inline bool obj_allocated(struct page *page, void *obj, unsigned long *ph
> return obj_tagged(page, obj, phandle, OBJ_ALLOCATED_TAG);
> }
>
> -#ifdef CONFIG_ZPOOL
> -static bool obj_stores_deferred_handle(struct page *page, void *obj,
> - unsigned long *phandle)
> -{
> - return obj_tagged(page, obj, phandle, OBJ_DEFERRED_HANDLE_TAG);
> -}
> -#endif

You can actually remove even more here.

The entire concept of deferred_handle is about serializing free with
reclaim. It can all go: OBJ_DEFERRED_HANDLE_TAG, the member in struct
link_free, this function here, find_deferred_handle_obj() (declaration
and implementation), free_handles(), and the deferred handle bits in
obj_free() including the handle parameter itself.