Re: [PATCHv5 3/7] zram: rework recompress target selection strategy

From: Sergey Senozhatsky
Date: Tue Oct 01 2024 - 04:41:15 EST


On (24/10/01 10:42), Dan Carpenter wrote:
> On Tue, Sep 17, 2024 at 11:09:08AM +0900, Sergey Senozhatsky wrote:
> > +static struct zram_pp_slot *select_pp_slot(struct zram_pp_ctl *ctl)
> > +{
> > + struct zram_pp_slot *pps = NULL;
> > + s32 idx = NUM_PP_BUCKETS - 1;
> > +
> > + /* The higher the bucket id the more optimal slot post-processing is */
> > + while (idx > 0) {
>
> Why is this not idx >= 0? Why skip the first bucket?

That's a typo, thanks for spotting this. Mind if I send a quick
fixup.patch online liner to Andrew?

Theoretically, we can't do any reasonable post-processing on slots
from bucket 0 (yet), because that bucket is for objects smaller than
64 bytes, but technically we should not skip it.