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]
Date:	Sat, 04 Apr 2009 10:28:11 +1100
From:	Nigel Cunningham <ncunningham@...a.org.au>
To:	Andreas Robinson <andr345@...il.com>
Cc:	Arjan van de Ven <arjan@...ux.intel.com>,
	"H. Peter Anvin" <hpa@...or.com>, Alain Knaff <alain@...ff.lu>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] lib: add fast lzo decompressor

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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ