All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <senozhatsky@chromium.org>
To: Aleksey Romanov <AVRomanov@sberdevices.ru>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	"minchan@kernel.org" <minchan@kernel.org>,
	"ngupta@vflare.org" <ngupta@vflare.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	kernel <kernel@sberdevices.ru>
Subject: Re: [PATCH v1] zram: add size class equals check into recompression
Date: Tue, 25 Oct 2022 19:08:54 +0900	[thread overview]
Message-ID: <Y1e1tvMMXU5+8JQP@google.com> (raw)
In-Reply-To: <20221025094859.7kbcqknlkmo4hj2y@cab-wsm-0029881.lan>

On (22/10/25 09:49), Aleksey Romanov wrote:
> On Tue, Oct 25, 2022 at 11:04:40AM +0900, Sergey Senozhatsky wrote:
> > On (22/10/25 10:53), Sergey Senozhatsky wrote:
> > > > +unsigned int zs_get_class_size(struct zs_pool *pool, unsigned int size)
> > > > +{
> > > > +	struct size_class *class = pool->size_class[get_size_class_index(size)];
> > > > +
> > > > +	return class->size;
> > > > +}
> > > > +EXPORT_SYMBOL_GPL(zs_get_class_size);

I wonder if we want to return class->index instead of class->size?

Something like this (a sketch)

  Return: the index of the zsmalloc &size_class that hold objects of the
  provided size.

unsigned int zs_lookup_class_index(struct zs_pool *pool, unsigned int size)
{
        struct size_class *class = pool->size_class[get_size_class_index(size)];

        return class->index;
}


  parent reply	other threads:[~2022-10-25 10:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-24 12:09 [PATCH v1] zram: add size class equals check into recompression Alexey Romanov
2022-10-24 20:59 ` Andrew Morton
2022-10-25  1:21   ` Sergey Senozhatsky
2022-10-25  1:53 ` Sergey Senozhatsky
2022-10-25  2:04   ` Sergey Senozhatsky
2022-10-25  9:49     ` Aleksey Romanov
2022-10-25  9:54       ` Sergey Senozhatsky
2022-10-25 10:08       ` Sergey Senozhatsky [this message]
2022-10-25 11:55         ` Aleksey Romanov
2022-10-25 12:38           ` Sergey Senozhatsky
2022-10-25 12:56             ` Aleksey Romanov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y1e1tvMMXU5+8JQP@google.com \
    --to=senozhatsky@chromium.org \
    --cc=AVRomanov@sberdevices.ru \
    --cc=akpm@linux-foundation.org \
    --cc=kernel@sberdevices.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan@kernel.org \
    --cc=ngupta@vflare.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.