Or 99.9%, if you map all those workspaces to one, similar to my patch.
The softirq context requires another set of workspaces, but in
principle the same could be done. Downside is that the Init- and End-
functions have to be called more often, which will surely cost cpu
time. I haven't done any benchmarks yet, so it remains to be shown if
this is relevant.
Your approach basically reintroduces the zmalloc() and zfree()
functions and makes behaviour under memory pressure interesting. It
is not impossible to get it right, but quite hard for sure.
> > 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.
Image a 2-cpu machine that does reads and writes to jffs2 on two
devices simultaneously. When one process is reading and one is
writing, everything is fine. When both perform the same operation,
the current design makes one wait at the semaphore, while one cpu is
idle. In my design, you have one workspace per cpu, so both can work
simultaneously.
What contention were you talking about? :)
The bh lock is another issue. Here we need another set of workspaces,
independent of the existing one (with or without my patch). But in
principly, the same should be possible.
Jörn
-- The grand essentials of happiness are: something to do, something to love, and something to hope for. -- Allan K. Chalmers - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/