public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: linux-kernel@vger.kernel.org
Subject: Re: libz, libbz2, ramfs and cramfs
Date: 18 Oct 2001 10:33:36 -0700	[thread overview]
Message-ID: <9qn3pg$73i$1@cesium.transmeta.com> (raw)
In-Reply-To: <19978.1003206943@kao2.melbourne.sgi.com> <3BCE4BB5.8060603@zytor.com> <15310.33191.397106.8530@cargo.ozlabs.ibm.com> <15310.51180.802846.33348@cargo.ozlabs.ibm.com>

Followup to:  <15310.51180.802846.33348@cargo.ozlabs.ibm.com>
By author:    Paul Mackerras <paulus@samba.org>
In newsgroup: linux.dev.kernel
> 
> ppp_deflate doesn't use next_out = NULL in this case, but it does use
> next_out = NULL when we are compressing a packet and the compressed
> packet turns out to be larger than the uncompressed.  With deflate
> there is a limit on how much larger the compressed packet would be, so
> it would be possible to give it a small extra buffer on the stack
> instead of using next_out = NULL.
> 

Discarding data is an important operation -- in zisofs that can happen
on a page lock conflict; I just use a dummy page for that.

> If we were going to standardize on a newer zlib in the kernel, I could
> change ppp_deflate to cope with that without too much pain, I think.
> The main thing I would want to add is a way to check what state the
> decompressor is in at the end of each packet - we want
> strm->state->blocks->mode == LENS at that point, which is not
> something that can be checked using the existing zlib interface.

The big issue is memory management.  I *think* the memory policy I
implemented in inflate_fs would work for PPP (you have to provide a
memory area of sufficient size, about 40K, at the time you open a
stream.  In the case of PPP this could probably just be vmalloc()'d at
the time the interface is created.  In the fs case, this is not
acceptable; rather, the filesystem in question has to maintain a
preallocation of memory and mutex it properly.)

	-hpa
-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt	<amsp@zytor.com>

  reply	other threads:[~2001-10-18 17:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-15 13:06 libz, libbz2, ramfs and cramfs Cristiano Paris
2001-10-15 22:53 ` H. Peter Anvin
2001-10-16  4:35 ` Keith Owens
2001-10-16  7:32   ` Matt D. Robinson
2001-10-17  8:31     ` H. Peter Anvin
2001-10-18  3:04       ` Paul Mackerras
2001-10-18  3:25         ` H. Peter Anvin
2001-10-18  7:15           ` Paul Mackerras
2001-10-18 12:15             ` Paul Mackerras
2001-10-18 17:33               ` H. Peter Anvin [this message]
2001-10-17  8:45     ` David Woodhouse
2001-10-16 17:36   ` David Woodhouse

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='9qn3pg$73i$1@cesium.transmeta.com' \
    --to=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox