Re: [RFC] LZO1X de/compression support

2007-05-23 Thread Jeremy Fitzhardinge
Bernd Petrovitsch wrote: > The "register" keyword is and was always from start *at most* a hint to > the C compiler to use a register for that variable (similar to "inline" > BTW). > So every C compiler is allowed to simply ignore the "register" for any > reason - be it "not implemented" or "the

Re: [RFC] LZO1X de/compression support

2007-05-23 Thread Jeremy Fitzhardinge
Bernd Petrovitsch wrote: The register keyword is and was always from start *at most* a hint to the C compiler to use a register for that variable (similar to inline BTW). So every C compiler is allowed to simply ignore the register for any reason - be it not implemented or the compiler knows

Re: [RFC] LZO1X de/compression support

2007-05-22 Thread Bernd Petrovitsch
On Tue, 2007-05-22 at 14:38 +0530, Nitin Gupta wrote: [...] > On 5/18/07, Andrey Panin <[EMAIL PROTECTED]> wrote: > > On 138, 05 18, 2007 at 03:28:31PM +0530, Nitin Gupta wrote: > > > + register const unsigned char *ip; > > > > register keyword is meaningless for today's compiler. > > But can

Re: [RFC] LZO1X de/compression support

2007-05-22 Thread Jan Engelhardt
On May 22 2007 14:38, Nitin Gupta wrote: > On 5/18/07, Andrey Panin <[EMAIL PROTECTED]> wrote: >> On 138, 05 18, 2007 at 03:28:31PM +0530, Nitin Gupta wrote: >> > + register const unsigned char *ip; >> >> register keyword is meaningless for today's compiler. > > But can we assume that gcc is

Re: [RFC] LZO1X de/compression support

2007-05-22 Thread Jan Engelhardt
On May 18 2007 15:28, Nitin Gupta wrote: > +/* lzo1x.h -- public interface of the LZO1X compression algorithm > + > + This file is part of the LZO real-time data compression library. > + > + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer > + Copyright (C) 2004 Markus Franz Xaver

Re: [RFC] LZO1X de/compression support

2007-05-22 Thread Pekka Enberg
Nitin Gupta wrote: Ok. I will make them inline functions now. Btw, the only reason why any sane compiler would not inline them is because it has reason to believe the end-result will be more efficient. AFAIK you only need to use __always_inline where it matters for correctness (like, for

Re: [RFC] LZO1X de/compression support

2007-05-22 Thread Nitin Gupta
Hi, On 5/18/07, Richard Purdie <[EMAIL PROTECTED]> wrote: > This patch, as of yet, only gives 'non-safe' version of decompressor. > The 'safe' version will be included soon. How are you planning to add that back? Please see newer patch posted. The LZO author had some concerns about this

Re: [RFC] LZO1X de/compression support

2007-05-22 Thread Nitin Gupta
On 5/22/07, Pekka Enberg <[EMAIL PROTECTED]> wrote: Nitin Gupta wrote: > What if compiler decides not to actully inline them? In that case > there will be significant perf. hit. Then you use __always_inline. Pekka Ok. I will make them inline functions now. Thanks,

Re: [RFC] LZO1X de/compression support

2007-05-22 Thread Nitin Gupta
Hi, On 5/18/07, Andrey Panin <[EMAIL PROTECTED]> wrote: On 138, 05 18, 2007 at 03:28:31PM +0530, Nitin Gupta wrote: > + register const unsigned char *ip; register keyword is meaningless for today's compiler. But can we assume that gcc is being used? What if we use compiler for which it

Re: [RFC] LZO1X de/compression support

2007-05-22 Thread Pekka Enberg
Nitin Gupta wrote: What if compiler decides not to actully inline them? In that case there will be significant perf. hit. Then you use __always_inline. Pekka - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL

Re: [RFC] LZO1X de/compression support

2007-05-22 Thread Nitin Gupta
Hi, On 5/18/07, Pekka Enberg <[EMAIL PROTECTED]> wrote: On 5/18/07, Nitin Gupta <[EMAIL PROTECTED]> wrote: > +#define DX2(p,s1,s2) \ > + (size_t)((p)[2]) << (s2)) ^ (p)[1]) << (s1)) ^ (p)[0]) > +#define DX3(p,s1,s2,s3) ((DX2((p)+1,s2,s3) << (s1)) ^ (p)[0]) > +#define DMUL(a,b)

Re: [RFC] LZO1X de/compression support

2007-05-22 Thread Jan Engelhardt
On May 18 2007 15:28, Nitin Gupta wrote: +/* lzo1x.h -- public interface of the LZO1X compression algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver

Re: [RFC] LZO1X de/compression support

2007-05-22 Thread Jan Engelhardt
On May 22 2007 14:38, Nitin Gupta wrote: On 5/18/07, Andrey Panin [EMAIL PROTECTED] wrote: On 138, 05 18, 2007 at 03:28:31PM +0530, Nitin Gupta wrote: + register const unsigned char *ip; register keyword is meaningless for today's compiler. But can we assume that gcc is being used?

Re: [RFC] LZO1X de/compression support

2007-05-22 Thread Bernd Petrovitsch
On Tue, 2007-05-22 at 14:38 +0530, Nitin Gupta wrote: [...] On 5/18/07, Andrey Panin [EMAIL PROTECTED] wrote: On 138, 05 18, 2007 at 03:28:31PM +0530, Nitin Gupta wrote: + register const unsigned char *ip; register keyword is meaningless for today's compiler. But can we assume

Re: [RFC] LZO1X de/compression support

2007-05-22 Thread Nitin Gupta
Hi, On 5/18/07, Pekka Enberg [EMAIL PROTECTED] wrote: On 5/18/07, Nitin Gupta [EMAIL PROTECTED] wrote: +#define DX2(p,s1,s2) \ + (size_t)((p)[2]) (s2)) ^ (p)[1]) (s1)) ^ (p)[0]) +#define DX3(p,s1,s2,s3) ((DX2((p)+1,s2,s3) (s1)) ^ (p)[0]) +#define DMUL(a,b) ((size_t) ((a) *

Re: [RFC] LZO1X de/compression support

2007-05-22 Thread Pekka Enberg
Nitin Gupta wrote: What if compiler decides not to actully inline them? In that case there will be significant perf. hit. Then you use __always_inline. Pekka - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL

Re: [RFC] LZO1X de/compression support

2007-05-22 Thread Nitin Gupta
Hi, On 5/18/07, Andrey Panin [EMAIL PROTECTED] wrote: On 138, 05 18, 2007 at 03:28:31PM +0530, Nitin Gupta wrote: + register const unsigned char *ip; register keyword is meaningless for today's compiler. But can we assume that gcc is being used? What if we use compiler for which it does

Re: [RFC] LZO1X de/compression support

2007-05-22 Thread Nitin Gupta
On 5/22/07, Pekka Enberg [EMAIL PROTECTED] wrote: Nitin Gupta wrote: What if compiler decides not to actully inline them? In that case there will be significant perf. hit. Then you use __always_inline. Pekka Ok. I will make them inline functions now. Thanks, Nitin

Re: [RFC] LZO1X de/compression support

2007-05-22 Thread Nitin Gupta
Hi, On 5/18/07, Richard Purdie [EMAIL PROTECTED] wrote: This patch, as of yet, only gives 'non-safe' version of decompressor. The 'safe' version will be included soon. How are you planning to add that back? Please see newer patch posted. The LZO author had some concerns about this

Re: [RFC] LZO1X de/compression support

2007-05-22 Thread Pekka Enberg
Nitin Gupta wrote: Ok. I will make them inline functions now. Btw, the only reason why any sane compiler would not inline them is because it has reason to believe the end-result will be more efficient. AFAIK you only need to use __always_inline where it matters for correctness (like, for

Re: [RFC] LZO1X de/compression support

2007-05-20 Thread Tomasz Chmielewski
Bill Rugolsky Jr. wrote: I'm certainly missing something but what are the advantages of this code (over current gzip etc.), and what will be using it? Richard's patchset added it to the crypto library and wired it into the JFFS2 file system. We recently started using LZO in a userland UDP

Re: [RFC] LZO1X de/compression support

2007-05-20 Thread Tomasz Chmielewski
Bill Rugolsky Jr. wrote: I'm certainly missing something but what are the advantages of this code (over current gzip etc.), and what will be using it? Richard's patchset added it to the crypto library and wired it into the JFFS2 file system. We recently started using LZO in a userland UDP

Re: [RFC] LZO1X de/compression support

2007-05-19 Thread Richard Purdie
On Sat, 2007-05-19 at 14:55 -0400, Bill Rugolsky Jr. wrote: > On Fri, May 18, 2007 at 11:14:57PM +0200, Krzysztof Halasa wrote: > > I'm certainly missing something but what are the advantages of this > > code (over current gzip etc.), and what will be using it? > > Richard's patchset added it to

Re: [RFC] LZO1X de/compression support

2007-05-19 Thread Bill Rugolsky Jr.
On Fri, May 18, 2007 at 11:14:57PM +0200, Krzysztof Halasa wrote: > I'm certainly missing something but what are the advantages of this > code (over current gzip etc.), and what will be using it? Richard's patchset added it to the crypto library and wired it into the JFFS2 file system. We

Re: [RFC] LZO1X de/compression support

2007-05-19 Thread devzero
>I'm certainly missing something but what are the advantages of this >code (over current gzip etc.), and what will be using it? lzo compresses/decompresses much faster and using less cpu this is how it compares: bzip2: best compression, but damn slow performance gzip: good compression with

Re: [RFC] LZO1X de/compression support

2007-05-19 Thread devzero
I'm certainly missing something but what are the advantages of this code (over current gzip etc.), and what will be using it? lzo compresses/decompresses much faster and using less cpu this is how it compares: bzip2: best compression, but damn slow performance gzip: good compression with good

Re: [RFC] LZO1X de/compression support

2007-05-19 Thread Bill Rugolsky Jr.
On Fri, May 18, 2007 at 11:14:57PM +0200, Krzysztof Halasa wrote: I'm certainly missing something but what are the advantages of this code (over current gzip etc.), and what will be using it? Richard's patchset added it to the crypto library and wired it into the JFFS2 file system. We recently

Re: [RFC] LZO1X de/compression support

2007-05-19 Thread Richard Purdie
On Sat, 2007-05-19 at 14:55 -0400, Bill Rugolsky Jr. wrote: On Fri, May 18, 2007 at 11:14:57PM +0200, Krzysztof Halasa wrote: I'm certainly missing something but what are the advantages of this code (over current gzip etc.), and what will be using it? Richard's patchset added it to the

Re: [RFC] LZO1X de/compression support

2007-05-18 Thread Krzysztof Halasa
"Nitin Gupta" <[EMAIL PROTECTED]> writes: > Facts for LZO (at least for original code. Should hold true for this > port also - hence the RFC!): > - The compressor can never overrun buffer. > - The "non-safe" version of decompressor can never overrun buffer if > compressed data is unmodified. I am

Re: [RFC] LZO1X de/compression support

2007-05-18 Thread Matt Mackall
On Fri, May 18, 2007 at 03:28:31PM +0530, Nitin Gupta wrote: > +/* lzo1x.h -- public interface of the LZO1X compression algorithm > + > + This file is part of the LZO real-time data compression library. > + > + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer > + Copyright (C) 2004

Re: [RFC] LZO1X de/compression support

2007-05-18 Thread Andrey Panin
On 138, 05 18, 2007 at 03:28:31PM +0530, Nitin Gupta wrote: > Hi, > > This is kernel port of LZO1X de/compression algo stripped down to just ~500 > LOC! > It is derived from original LZO 2.02 code found at: > http://www.oberhumer.com/opensource/lzo/download/ > The code has also been reformatted

Re: [RFC] LZO1X de/compression support

2007-05-18 Thread Richard Purdie
On Fri, 2007-05-18 at 16:57 +0530, Nitin Gupta wrote: > On 5/18/07, Heikki Orsila <[EMAIL PROTECTED]> wrote: > > Good work.. > > > > On Fri, May 18, 2007 at 03:28:31PM +0530, Nitin Gupta wrote: > > > Facts for LZO (at least for original code. Should hold true for this > > > port also - hence the

Re: [RFC] LZO1X de/compression support

2007-05-18 Thread Richard Purdie
Hi, On Fri, 2007-05-18 at 15:28 +0530, Nitin Gupta wrote: > This is kernel port of LZO1X de/compression algo stripped down to just ~500 > LOC! > It is derived from original LZO 2.02 code found at: > http://www.oberhumer.com/opensource/lzo/download/ > The code has also been reformatted to match

Re: [RFC] LZO1X de/compression support

2007-05-18 Thread Nitin Gupta
Hi, Thanks for review. My comments inline. On 5/18/07, Heikki Orsila <[EMAIL PROTECTED]> wrote: Good work.. On Fri, May 18, 2007 at 03:28:31PM +0530, Nitin Gupta wrote: > Facts for LZO (at least for original code. Should hold true for this > port also - hence the RFC!): > - The compressor can

Re: [RFC] LZO1X de/compression support

2007-05-18 Thread Pekka Enberg
On 5/18/07, Pekka Enberg <[EMAIL PROTECTED]> wrote: So how about making that a little less verbose. Say like: Copyright (c) 1996-2005 Markus Franz Xaver and Johannes Oberhumer Oh, the author's name really is "Markus Franz Xaver Johannes Oberhumer." But please make the copyright statement one

Re: [RFC] LZO1X de/compression support

2007-05-18 Thread Pekka Enberg
On 5/18/07, Nitin Gupta <[EMAIL PROTECTED]> wrote: + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer [snip] So how about making that a little less verbose. Say like: Copyright (c) 1996-2005 Markus Franz Xaver and

Re: [RFC] LZO1X de/compression support

2007-05-18 Thread Heikki Orsila
Good work.. On Fri, May 18, 2007 at 03:28:31PM +0530, Nitin Gupta wrote: > Facts for LZO (at least for original code. Should hold true for this > port also - hence the RFC!): > - The compressor can never overrun buffer. > - The "non-safe" version of decompressor can never overrun buffer if >

[RFC] LZO1X de/compression support

2007-05-18 Thread Nitin Gupta
Hi, This is kernel port of LZO1X de/compression algo stripped down to just ~500 LOC! It is derived from original LZO 2.02 code found at: http://www.oberhumer.com/opensource/lzo/download/ The code has also been reformatted to match general kernel style. Facts for LZO (at least for original code.

[RFC] LZO1X de/compression support

2007-05-18 Thread Nitin Gupta
Hi, This is kernel port of LZO1X de/compression algo stripped down to just ~500 LOC! It is derived from original LZO 2.02 code found at: http://www.oberhumer.com/opensource/lzo/download/ The code has also been reformatted to match general kernel style. Facts for LZO (at least for original code.

Re: [RFC] LZO1X de/compression support

2007-05-18 Thread Heikki Orsila
Good work.. On Fri, May 18, 2007 at 03:28:31PM +0530, Nitin Gupta wrote: Facts for LZO (at least for original code. Should hold true for this port also - hence the RFC!): - The compressor can never overrun buffer. - The non-safe version of decompressor can never overrun buffer if compressed

Re: [RFC] LZO1X de/compression support

2007-05-18 Thread Pekka Enberg
On 5/18/07, Pekka Enberg [EMAIL PROTECTED] wrote: So how about making that a little less verbose. Say like: Copyright (c) 1996-2005 Markus Franz Xaver and Johannes Oberhumer Oh, the author's name really is Markus Franz Xaver Johannes Oberhumer. But please make the copyright statement one

Re: [RFC] LZO1X de/compression support

2007-05-18 Thread Pekka Enberg
On 5/18/07, Nitin Gupta [EMAIL PROTECTED] wrote: + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer [snip] So how about making that a little less verbose. Say like: Copyright (c) 1996-2005 Markus Franz Xaver and Johannes

Re: [RFC] LZO1X de/compression support

2007-05-18 Thread Nitin Gupta
Hi, Thanks for review. My comments inline. On 5/18/07, Heikki Orsila [EMAIL PROTECTED] wrote: Good work.. On Fri, May 18, 2007 at 03:28:31PM +0530, Nitin Gupta wrote: Facts for LZO (at least for original code. Should hold true for this port also - hence the RFC!): - The compressor can

Re: [RFC] LZO1X de/compression support

2007-05-18 Thread Richard Purdie
On Fri, 2007-05-18 at 16:57 +0530, Nitin Gupta wrote: On 5/18/07, Heikki Orsila [EMAIL PROTECTED] wrote: Good work.. On Fri, May 18, 2007 at 03:28:31PM +0530, Nitin Gupta wrote: Facts for LZO (at least for original code. Should hold true for this port also - hence the RFC!): - The

Re: [RFC] LZO1X de/compression support

2007-05-18 Thread Richard Purdie
Hi, On Fri, 2007-05-18 at 15:28 +0530, Nitin Gupta wrote: This is kernel port of LZO1X de/compression algo stripped down to just ~500 LOC! It is derived from original LZO 2.02 code found at: http://www.oberhumer.com/opensource/lzo/download/ The code has also been reformatted to match

Re: [RFC] LZO1X de/compression support

2007-05-18 Thread Andrey Panin
On 138, 05 18, 2007 at 03:28:31PM +0530, Nitin Gupta wrote: Hi, This is kernel port of LZO1X de/compression algo stripped down to just ~500 LOC! It is derived from original LZO 2.02 code found at: http://www.oberhumer.com/opensource/lzo/download/ The code has also been reformatted to

Re: [RFC] LZO1X de/compression support

2007-05-18 Thread Matt Mackall
On Fri, May 18, 2007 at 03:28:31PM +0530, Nitin Gupta wrote: +/* lzo1x.h -- public interface of the LZO1X compression algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus

Re: [RFC] LZO1X de/compression support

2007-05-18 Thread Krzysztof Halasa
Nitin Gupta [EMAIL PROTECTED] writes: Facts for LZO (at least for original code. Should hold true for this port also - hence the RFC!): - The compressor can never overrun buffer. - The non-safe version of decompressor can never overrun buffer if compressed data is unmodified. I am not sure