Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1763549AbZDCMxX (ORCPT ); Fri, 3 Apr 2009 08:53:23 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755467AbZDCMxN (ORCPT ); Fri, 3 Apr 2009 08:53:13 -0400 Received: from mu-out-0910.google.com ([209.85.134.186]:24358 "EHLO mu-out-0910.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755201AbZDCMxL (ORCPT ); Fri, 3 Apr 2009 08:53:11 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; b=ExeWYGalinOw4PkwAC2lkvlSpL2hFCnERnB+nlYumX3j/N5N4IzQOtxxZJCCf7fedR Bqx389Yy3m83L9zdzsyWJkmMMn/sylF8dbYxL1cXcuX7x8h567oj5ipg34CZ2mEDeFev Ygt7U0uqvhOfz+upBzlNSYhMD/1FGcMhG23qs= Subject: Re: [PATCH 1/2] lib: add fast lzo decompressor From: Andreas Robinson To: Nigel Cunningham Cc: Arjan van de Ven , "H. Peter Anvin" , Alain Knaff , linux-kernel@vger.kernel.org In-Reply-To: <1238759294.9692.49.camel@nigel-laptop> References: <1238593252-3435-1-git-send-email-andr345@gmail.com> <1238593252-3435-2-git-send-email-andr345@gmail.com> <49D3927A.2050406@zytor.com> <1238613730.10514.35.camel@andreas-desktop> <49D3D4C0.1080506@zytor.com> <1238624827.15230.58.camel@andreas-desktop> <49D3EDEA.4090803@zytor.com> <49D3F4A3.1040609@linux.intel.com> <1238629202.9027.111.camel@nigel-laptop> <1238675410.13249.42.camel@andreas-desktop> <1238705969.10479.8.camel@nigel-laptop> <1238756060.11839.19.camel@andreas-desktop> <1238759294.9692.49.camel@nigel-laptop> Content-Type: text/plain Date: Fri, 03 Apr 2009 14:53:03 +0200 Message-Id: <1238763183.13099.19.camel@andreas-desktop> Mime-Version: 1.0 X-Mailer: Evolution 2.24.3 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1612 Lines: 43 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! Cheers, Andreas -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/