vmalloc for zlib workspace

Jörn Engel joern at wohnheim.fh-wedel.de
Mon May 26 12:12:42 EDT 2003


On Mon, 26 May 2003 16:33:24 +0200, Jörn Engel wrote:
> 
> How about the following:
> 
> static int workspace_pid[some];
> 	...
> 	for (i=0; i<some; i++) {
> 		if (likely(workspace_pid[i] == current_pid))
> 			break;
> 	}

Why do I always have to produce 90% crap before the other 10% come
out?  Ok, ok, don't tell me! ;)

The information, which workspace belongs to which process can be put
into the z_stream.  That removes the ugly code above.  The
information, which workspaces are still free can now be put into
bit-array, aka long and the loop be replaces with fls().

This design should perform as good as the current one in the worst
case and a lot better for SMP and several parallel zlib processes
currently on the same semaphore.

Maybe this time, the design is complete.  Any comments before the
patch is finished and benchmarks prove me right or wrong?

Jörn

-- 
Those who come seeking peace without a treaty are plotting.
-- Sun Tzu



More information about the linux-mtd mailing list