[PATCH RFC] 1/2 central workspace for zlib
Jörn Engel
joern at wohnheim.fh-wedel.de
Sat May 31 04:11:29 EDT 2003
On Sat, 31 May 2003 00:59:09 -0700, David S. Miller wrote:
>
> You can't leave the per-cpu workspace in an indeterminate
> state, you'll context switch and meanwhile that workspace will
> be used by another client or you'll next get scheduled on
> a different cpu and use a different workspace.
Did you read the patch?
When getting scheduled, the workspace remains associated with the
owning process ( z->workspace, z->ws_num ). Other processes trying to
grab a workspace will get put on a waitqueue ( zlib_workspace_sem ).
The workspace is not exactly per cpu, it is per process. Just the
amount of workspaces happens to be equal to the amount of cpus in the
system, but a couple more or less should work just as well.
In softirq context you would be right. Preempt is disabled anyway and
cpu affinity comes for free.
Jörn
--
A defeated army first battles and then seeks victory.
-- Sun Tzu
More information about the linux-mtd
mailing list