[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y3gJZxm3OlXmlTVj@google.com>
Date: Fri, 18 Nov 2022 14:38:31 -0800
From: Minchan Kim <minchan@...nel.org>
To: Nhat Pham <nphamcs@...il.com>
Cc: hannes@...xchg.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, ngupta@...are.org,
senozhatsky@...omium.org, akpm@...ux-foundation.org,
sjenning@...hat.com, ddstreet@...e.org, vitaly.wool@...sulko.com
Subject: Re: [PATCH v5 6/6] zsmalloc: Implement writeback mechanism for
zsmalloc
On Fri, Nov 18, 2022 at 02:08:08PM -0800, Nhat Pham wrote:
> Thanks a lot for the suggestions so far and for the review, Minchan!
> Quick question about your last comment:
>
> >> +#ifdef CONFIG_ZPOOL
> >
> > Let's remove the ifdef machinery here.
> >
> >> + /* Free all deferred handles from zs_free */
> >> + free_handles(pool, zspage);
> >> +#endif
>
> free_handles() here is for the deferred handle freeing, which is also
> under CONFIG_ZPOOL now, so I don't think we should remove the #ifdef
> CONFIG_ZPOOL here, no? Let me know if I'm misunderstanding your
> suggestion, or if you have any further comments regarding this patch.
What I meant is
#ifdef CONFIG_ZPOOL
/*
* Free all the deferred handles whose objects are freed in zs_free.
*/
static void free_handles(struct zs_pool *pool, struct zspage *zspage)
{
unsigned long handle = (unsigned long)zspage->deferred_handles;
while (handle) {
unsigned long nxt_handle = handle_to_obj(handle);
cache_free_handle(pool, handle);
handle = nxt_handle;
}
}
#else
static inline void free_handles(struct zs_pool *pool, struct zspage *zspage) {}
#endif
And then we could do
__free_zspage
free_handles(pool, zspage);
So without CONFIG_ZPOOL, the free_nandles function will be void.
Powered by blists - more mailing lists