[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230624022917.GF2934656@google.com>
Date: Sat, 24 Jun 2023 11:29:17 +0900
From: Sergey Senozhatsky <senozhatsky@...omium.org>
To: Alexey Romanov <AVRomanov@...rdevices.ru>
Cc: Sergey Senozhatsky <senozhatsky@...omium.org>,
Minchan Kim <minchan@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/2] zsmalloc: do not scan for allocated objects in empty
zspage
On (23/06/23 10:49), Alexey Romanov wrote:
> > +static bool zspage_empty(struct zspage *zspage)
> > +{
> > + return get_zspage_inuse(zspage) == 0;
> > +}
> > +
> > /**
> > * zs_lookup_class_index() - Returns index of the zsmalloc &size_class
> > * that hold objects of the provided size.
> > @@ -1625,6 +1630,10 @@ static void migrate_zspage(struct zs_pool *pool, struct size_class *class,
> > obj_idx++;
> > record_obj(handle, free_obj);
> > obj_free(class->size, used_obj);
> > +
> > + /* Stop if there are no more objects to migrate */
> > + if (zspage_empty(get_zspage(s_page)))
> > + break;
> > }
> >
> > /* Remember last position in this iteration */
> > --
> > 2.41.0.162.gfafddb0af9-goog
> >
>
> I think we can add similar check in zs_reclaim_page() function.
> There we also scan zspage to find the allocated object.
LRU was moved to zswap, so zs_reclaim_page() doesn't exist any longer
(in linux-next).
Powered by blists - more mailing lists