All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Robinson <andr345@gmail.com>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Alain Knaff <alain@knaff.lu>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] lib: add fast lzo decompressor
Date: Thu, 02 Apr 2009 00:27:07 +0200	[thread overview]
Message-ID: <1238624827.15230.58.camel@andreas-desktop> (raw)
In-Reply-To: <49D3D4C0.1080506@zytor.com>

On Wed, 2009-04-01 at 13:55 -0700, H. Peter Anvin wrote:
> Andreas Robinson wrote:
> > 
> > Perhaps the system can default to the safe decompressor for normal use
> > and choose the fast one if STATIC is defined or when system_state ==
> > SYSTEM_BOOTING?
> > 
> 
> Do we really need two pieces of code?

To get the higher speed offered by the fast function, yes.

Merging the two with some macro magic and then compile twice with
different macro definitions could work though. That might hurt the
readability of the code a bit. Or help. :-) I'll look into it.

Anyway, I assume it is maintainability rather than size you're concerned
about here?

The duplicate function adds just 1.7 KB to the kernel and you throw it
out once the kernel has finished booting.

OTOH, the safe version is far from useless. 

I estimate (but haven't tested yet) that you would lose about 40 ms in
the Eee test case. That is, the boot-time savings are reduced from 123
to perhaps 85 ms which is still acceptable. It is certainly much less
complicated than the alternatives, so if that's what you would prefer I
can go that way.

>   What if we have memory corruption 
> during early boot - it seems we'd want to at least try to catch that 
> with an error message rather than just crashing.

This is very easy to do, so consider it done.

The decompressor is essentially a glorified memcpy that can copy the
same data to several locations. You only have to check whether the write
pointer has passed the end of the output buffer to see if something went
wrong.



  reply	other threads:[~2009-04-01 22:27 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 [this message]
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
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=1238624827.15230.58.camel@andreas-desktop \
    --to=andr345@gmail.com \
    --cc=alain@knaff.lu \
    --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.