From: James Morris <jmorris@intercode.com.au>
To: "Jörn Engel" <joern@wohnheim.fh-wedel.de>
Cc: David Woodhouse <dwmw2@infradead.org>,
matsunaga <matsunaga_kazuhisa@yahoo.co.jp>,
<linux-mtd@lists.infradead.org>, <linux-kernel@vger.kernel.org>,
"David S. Miller" <davem@redhat.com>
Subject: Re: [PATCH RFC] 1/2 central workspace for zlib
Date: Sat, 31 May 2003 01:29:42 +1000 (EST) [thread overview]
Message-ID: <Mutt.LNX.4.44.0305310101550.30969-100000@excalibur.intercode.com.au> (raw)
In-Reply-To: <20030530144959.GA4736@wohnheim.fh-wedel.de>
On Fri, 30 May 2003, Jörn Engel wrote:
> The following creates a central workspace per cpu for the zlib. The
> original idea was to save memory for embedded, but this should also
> improve performance for smp.
>
> Currently, each user of the zlib has to provide a workspace for the
> zlib to draw memory from. Each workspace amounts to 400k for deflate
> or 50k for inflate. Four users exist, as of 2.4.20:
> jffs2: inflate & deflate, initialized once, 450k
> cramfs: inflate, initialized once, 50k
> zisofs: inflate, initialized once, 50k
> ppp: inflate & deflate, per channel, 450k * n
In 2.5 (and soon 2.4), the crypto/deflate.c module makes use of zlib as
well. This is typically used in ipsec for ipcomp. Each ipcomp security
association has a zlib context, and access to the workspace is serialized
by the security association's bh lock.
(Something needs to be done for this particular case in general: a box
with 1000 tunnels could use use 450MB of atomic kernel memory just for
zlib workspaces alone. A solution I've been looking at for this is to
allow workspaces to be dynamically sized based on the compression
parameters instead of using worst-case figures. The memory savings may be
up to 90% in this case).
> This patch creates an extra workspace of 400k per cpu, that is used for
> both inflate and deflate. One of the central workspaces is used for
> users that don't provide their own. Semaphore protection is done in
> zlib_(in|de)flateInit() and zlib_(in|de)flateEnd, so the user has to
> call those functions more often to release the semaphores before
> returning to userspace.
This won't work for the bh lock protected case outlined above, and will
cause contention between different users of zlib.
- James
--
James Morris
<jmorris@intercode.com.au>
next prev parent reply other threads:[~2003-05-30 15:17 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-30 14:49 Jörn Engel
2003-05-30 15:29 ` James Morris [this message]
2003-05-30 17:43 ` Jörn Engel
2003-05-31 0:14 ` David S. Miller
2003-05-31 6:48 ` Jörn Engel
2003-05-31 6:55 ` David S. Miller
2003-05-31 7:56 ` Jörn Engel
2003-05-31 7:59 ` David S. Miller
2003-05-31 8:11 ` Jörn Engel
2003-05-31 8:12 ` David S. Miller
2003-05-31 8:22 ` Con Kolivas
2003-06-01 1:25 ` Matt Mackall
2003-06-02 12:19 ` Jörn Engel
2003-05-31 9:09 ` Arjan van de Ven
2003-05-31 6:20 ` David S. Miller
2003-05-31 10:51 ` James Morris
2003-05-31 11:07 ` Jörn Engel
2003-06-02 15:15 ` matsunaga
2003-06-02 15:36 ` Jörn Engel
2003-06-02 15:40 ` David Woodhouse
2003-06-02 15:53 ` Jörn Engel
2003-06-02 15:59 ` David Woodhouse
2003-06-02 16:37 ` Jörn Engel
2003-06-02 19:36 ` David Woodhouse
2003-06-02 20:54 ` Jörn Engel
2003-06-02 16:07 ` matsunaga
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=Mutt.LNX.4.44.0305310101550.30969-100000@excalibur.intercode.com.au \
--to=jmorris@intercode.com.au \
--cc=davem@redhat.com \
--cc=dwmw2@infradead.org \
--cc=joern@wohnheim.fh-wedel.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=matsunaga_kazuhisa@yahoo.co.jp \
/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
all inboxes | Powered by JetHome®