All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nigel Cunningham <ncunningham@crca.org.au>
To: Andreas Robinson <andr345@gmail.com>
Cc: Arjan van de Ven <arjan@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>, Alain Knaff <alain@knaff.lu>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] lib: add fast lzo decompressor
Date: Sat, 04 Apr 2009 10:28:11 +1100	[thread overview]
Message-ID: <1238801291.6802.3.camel@nigel-laptop> (raw)
In-Reply-To: <1238763183.13099.19.camel@andreas-desktop>

Hi.

On Fri, 2009-04-03 at 14:53 +0200, Andreas Robinson wrote: 
> On Fri, 2009-04-03 at 22:48 +1100, Nigel Cunningham wrote:
> 
> > Okay. Am I right in thinking (from staring at the code) that the
> > compression algo just assumes it has an output buffer big enough? (I
> > don't see it checking out_len, only writing to it).
> 
> I came to that conclusion too. And it is not just LZO that needs a
> bigger buffer. Non-compressed blocks in deflate streams occupy 4 bytes
> more than the original, according to RFC 1951 section 3.2.4.
> 
> >  If that's the case,
> > I guess I need to (ideally) persuade the cryptoapi guys to extend the
> > api so you can find out how big an output buffer is needed for a
> > particular compression algorithm - or learn how they've already done
> > that (though it doesn't look like it to me).
> 
> I can not see anything to that effect either.
> 
> > > If there are multiple threads perhaps they clobber each other's output
> > > buffers?
> > 
> > Nope. The output buffers you see here are fed to the next part of the
> > pipeline (the block I/O code), which combines them (under a mutex) into
> > a stream of |index|size|data|index|size|data... so that we don't have to
> > worry at all about which processor compressed (or decompresses data
> > later). As I said earlier, it's worked fine with LZF - or no compression
> > - for years. It's just LZO that causes me problems.
> > 
> > Thanks!
> > 
> > Nigel
> > 
> I'm glad I was able to help!

Vmalloc'ing a 2 * PAGE_SIZE buffer seems to have done the trick - I've
done a couple of cycles with no problems and slightly better throughput
than LZF. A couple of tests in a row of just compressing data using
first LZO then LZF gave 260MB/s vs 230MB/s throughput respectively.
Doing real writes slows things down so that the difference is only about
10MB/s (I only have a 53MB/s SATA HDD), but that's still better than a
poke in the eye!

Thanks!

Nigel


  reply	other threads:[~2009-04-03 23:28 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-01 13:40 [PATCH 0/2] lib, initramfs: Add initramfs LZO compression Andreas Robinson
2009-04-01 13:40 ` [PATCH 1/2] lib: add fast lzo decompressor Andreas Robinson
2009-04-01 16:12   ` H. Peter Anvin
2009-04-01 19:22     ` Andreas Robinson
2009-04-01 20:55       ` H. Peter Anvin
2009-04-01 22:27         ` Andreas Robinson
2009-04-01 22:42           ` H. Peter Anvin
2009-04-01 23:11             ` Arjan van de Ven
2009-04-01 23:40               ` Nigel Cunningham
2009-04-02 12:30                 ` Andreas Robinson
2009-04-02 20:59                   ` Nigel Cunningham
2009-04-03 10:54                     ` Andreas Robinson
2009-04-03 11:48                       ` Nigel Cunningham
2009-04-03 12:53                         ` Andreas Robinson
2009-04-03 23:28                           ` Nigel Cunningham [this message]
2009-04-02  0:02               ` H. Peter Anvin
2009-04-02 12:13             ` Andreas Robinson
2009-04-02 14:30       ` John Stoffel
2009-04-03  9:49         ` Andreas Robinson
2009-04-03 18:35           ` H. Peter Anvin
2009-04-04 14:34             ` Andreas Robinson
2009-04-01 13:40 ` [PATCH 2/2] lib, initramfs: add support for LZO-compressed initramfs Andreas Robinson
2009-04-01 19:29 ` [PATCH 3/3] lib: enable lzo-compressed kernels Andreas Robinson

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=1238801291.6802.3.camel@nigel-laptop \
    --to=ncunningham@crca.org.au \
    --cc=alain@knaff.lu \
    --cc=andr345@gmail.com \
    --cc=arjan@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.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.