From: "Markus F.X.J. Oberhumer" <markus@oberhumer.com>
To: Richard Purdie <richard@openedhand.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Michael-Luke Jones <mlj28@cam.ac.uk>,
lkml <linux-kernel@vger.kernel.org>,
Satyam Sharma <satyam.sharma@gmail.com>,
Nitin Gupta <nitingupta910@gmail.com>
Subject: Re: [RFC] [-mm] Remove 'unsafe' LZO decompressor
Date: Fri, 25 May 2007 02:40:31 +0200 [thread overview]
Message-ID: <4656307F.6010204@oberhumer.com> (raw)
In-Reply-To: <1180045572.12821.35.camel@localhost.localdomain>
Richard Purdie wrote:
> On Thu, 2007-05-24 at 11:50 -0700, Andrew Morton wrote:
>> On Thu, 24 May 2007 18:15:17 +0100
>> Michael-Luke Jones <mlj28@cam.ac.uk> wrote:
>>
>>> Attached is a patch which may be desirable for -mm. It applies
>>> directly to 2.6.22-rc2-mm1.
>>>
>>> The patch removes the 'unsafe' LZO decompression function, lowering
>>> the size of the minilzo.c file by nearly 500 out of an original 1727
>>> lines. It also removes references to the 'unsafe' decompression
>>> function in the public LZO header and the EXPORT_SYMBOL_GPL declaration.
> [...]
>>> Comments / disagreement all welcome :)
>> This is obviously a highly desirable thing to do for a number of reasons.
>> But have we quantified the performance difference?
>
> Ok, I've done some tests:
>
> 1. Comparing the safe and unsafe functions
>
> For my minilzo kernel patch, the safe version showed a 7.2% performance
> hit. For Nitin's patch, it showed a 3.2% performance hit (but see
> below).
>
> Could be a lot worse and I don't object to the removal of the unsafe
> version.
>
> 2. Comparing Nitin's code with my minilzo based kernel patch.
>
> My kernel patch is about 2.25 times faster at decompression (16725Kb/ms
> vs 7399Kb/ms) and fractionally faster at compression (1434kb/ms vs
> 1490kb/ms). As things stand the performance of Nitin's patch is
> therefore unacceptable as that is a significant decompression
> performance loss.
Please do _not_ rewrite the LZO implementation just for coding style principles.
The current miniLZO implementation is _extrememly_ well tested, pretty
optimized and quite portable.
I agree that the implementation may look confusing, but you should be able to
make it look much better by removing all the unused #defines and #ifdef code
paths - LZO supports exotic things like 16-bit DOS and CRAY PVP memory models
which obviously are not needed in the kernel and account for quite a number of
abstractions (which are implemented through the preprocessor).
Finally the current version has been tested with a lot of compilers and
contains accumulated knowledge about some hairy things - see
http://gcc.gnu.org/PR25196 for an example, as well as some not-yet identified
aliasing issue.
~Markus
> These tests are on 32 bit Intel and in userspace but I've found them to
> be a pretty good indicator of what happens in the real world and on
> other architectures.
> For simplicity I made these tests with some existing code I had around
> but its licence is such I can't share it, much to my frustration.
>
> Cheers,
>
> Richard
>
--
Markus Oberhumer, <markus@oberhumer.com>, http://www.oberhumer.com/
next prev parent reply other threads:[~2007-05-25 0:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-24 17:15 [RFC] [-mm] Remove 'unsafe' LZO decompressor Michael-Luke Jones
2007-05-24 18:50 ` Andrew Morton
2007-05-24 19:13 ` Michael-Luke Jones
2007-05-24 22:26 ` Richard Purdie
2007-05-25 0:40 ` Markus F.X.J. Oberhumer [this message]
2007-05-25 6:35 ` Nitin Gupta
2007-05-25 6:10 ` Nitin Gupta
2007-05-29 19:43 ` Andrew Morton
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=4656307F.6010204@oberhumer.com \
--to=markus@oberhumer.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mlj28@cam.ac.uk \
--cc=nitingupta910@gmail.com \
--cc=richard@openedhand.com \
--cc=satyam.sharma@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