On (23/06/21 13:41), 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. > > @@ -1787,6 +1792,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, NULL); > > + > > + /* Stop if there are no more objects to migrate */ > > + if (zspage_empty(get_zspage(s_page))) > > + break; > > } > > Yes it seems my version is not as good as I thought. Looks bad for an > architecturally dependent PAGE_SIZE. [..] Well, we are looking for a solution that is both reasonable (perf wise) and is maintainable. > I can implement this option. I'll test this and send patch this week. Either that or, if Suggested-by: Alexey Romanov <AVRomanov@xxxxxxxxxxxxxx> is good enough for you, then I can send a series tonight or tomorrow (after some testing). I have two more patches on top of that one.