mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nick Terrell <terrelln@fb.com>
To: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"minchan@kernel.org" <minchan@kernel.org>,
	Yann Collet <cyan@fb.com>
Subject: Re: [PATCH] zram: add zstd to the supported algorithms list
Date: Fri, 25 Aug 2017 02:09:20 +0000	[thread overview]
Message-ID: <08620C31-AD6A-4DDB-ACA6-22243920AE1E@fb.com> (raw)
In-Reply-To: <20170825015301.GB743@jagdpanzerIV.localdomain>

On 8/24/17, 6:53 PM, "Sergey Senozhatsky" <sergey.senozhatsky.work@gmail.com> wrote:
> On (08/25/17 01:35), Nick Terrell wrote:
> > On 8/24/17, 5:49 PM, "Joonsoo Kim" <iamjoonsoo.kim@lge.com> wrote:
> > > On Thu, Aug 24, 2017 at 09:33:54PM +0000, Nick Terrell wrote:
> > > > On Thu, Aug 24, 2017 at 10:49:36AM +0900, Sergey Senozhatsky wrote:
> > > > > Add ZSTD to the list of supported compression algorithms.
> > > > > 
> > > > > Official benchmarks [1]:
> > > > 
> > > > Awesome! Let me know if you need anything from me.
> > > > 
> > > Hello, Nick.
> > > 
> > > Awesome work!!!
> > > 
> > > Let me ask a question.
> > > Zram compress and decompress a small data (a page) and your github
> > > site says that using predefined dictionary would be helpful in this
> > > situation. However, it seems that compression crypto API for zstd
> > > doesn't use ZSTD_compress_usingDict(). Is there any plan to support
> > > it?
> 
> excellent question, Joonsoo.
> 
> > I think using dictionaries in zram could be very interesting. We could for
> > example, take a random sample of the RAM and use that as the dictionary
> > for compression. E.g. take 32 512B samples from RAM and build a 16 KB
> > dictionary (sizes may vary).
> > 
> > I'm not sure how you would pass a dictionary into the crypto compression
> > API, but I'm sure we can make something work if dictionary compression
> > proves to be beneficial enough.
> 
> a dictionaty pointer can be in `struct zstd_ctx'.

Sorry I'm not super familiar with the crypto API. How would the user
initialize the dictionary in the `struct zstd_ctx'? I guess you could
either expose the struct in some header, or provide a function that
initializes it, but that isn't generic. Does the crypto library already
have a standard way to provide extra information?

> > What data have you, or anyone, used for benchmarking compression ratio and 
> > speed for RAM? Since it is such a specialized application, the standard
> > compression benchmarks aren't very applicable.
> 
> 
> yeah, I thought that zstd uses dicts unconditionally.
> 
> I used my own simple minded test script:
> 	https://github.com/sergey-senozhatsky/zram-perf-test
> 
> it basically invokes fio with a 'static compression buffer', because
> we want to have the exactly same data to be compressed when I compare
> algorithms... I guess I need to improve it, somehow.

I'll check it out, thanks!

> 
> 	-ss
> 

  reply	other threads:[~2017-08-25  2:09 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <<20170824014936.4738-1-sergey.senozhatsky@gmail.com>
2017-08-24 21:33 ` Nick Terrell
2017-08-25  0:49   ` Joonsoo Kim
2017-08-25  1:35     ` Nick Terrell
2017-08-25  1:53       ` Sergey Senozhatsky
2017-08-25  2:09         ` Nick Terrell [this message]
2017-08-25  2:21           ` Sergey Senozhatsky
2017-08-25  2:46             ` Nick Terrell
2017-08-25  5:26               ` Sergey Senozhatsky
2017-08-25  2:02       ` Joonsoo Kim
2017-08-25  5:19       ` Minchan Kim
2017-08-25 19:31         ` Nick Terrell
2017-08-28  6:52           ` Minchan Kim
2017-08-25  0:51   ` Sergey Senozhatsky
2017-08-24  1:49 Sergey Senozhatsky
2017-08-24  4:30 ` Minchan Kim
2017-08-24 14:04   ` Sergey Senozhatsky
2017-08-25  4:50     ` Minchan Kim
2017-08-25  5:06       ` Sergey Senozhatsky
2017-08-25  5:27         ` Sergey Senozhatsky
2017-08-25  5:36         ` Minchan Kim
2017-08-25  7:45           ` Sergey Senozhatsky
2017-08-25  8:08             ` Adam Borowski
2017-08-25 18:55       ` Nick Terrell

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=08620C31-AD6A-4DDB-ACA6-22243920AE1E@fb.com \
    --to=terrelln@fb.com \
    --cc=cyan@fb.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=minchan@kernel.org \
    --cc=sergey.senozhatsky.work@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®