lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y1e1tvMMXU5+8JQP@google.com>
Date:   Tue, 25 Oct 2022 19:08:54 +0900
From:   Sergey Senozhatsky <senozhatsky@...omium.org>
To:     Aleksey Romanov <AVRomanov@...rdevices.ru>
Cc:     Sergey Senozhatsky <senozhatsky@...omium.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        "minchan@...nel.org" <minchan@...nel.org>,
        "ngupta@...are.org" <ngupta@...are.org>,
        "linux-mm@...ck.org" <linux-mm@...ck.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        kernel <kernel@...rdevices.ru>
Subject: Re: [PATCH v1] zram: add size class equals check into recompression

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;
}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ