vmalloc for zlib workspace
joern at wohnheim.fh-wedel.de
Thu May 22 15:57:08 EDT 2003
On Fri, 23 May 2003 00:40:37 +0900, matsunaga wrote:
> In the jffs2_zlib_init() function of fs/jffs2/comr_zlib.c.
> workspace is aquired by vmalloc.
> But it could be allocated by static variable, like;
> static char dbuf[WORKSPACESIZE];
> int __init jffs2_zlib_init(void)
> def_strm.workspace = dbuf;
> Care should be taken as to the workspace size, but it is old refined library and it would hardly be changed.
> It would reduce TLB load and improve performance (a little).
static void deflate_workspace[WORKSPACESIZE];
static void inflate_workspace[WORKSPACESIZE];
int __init jffs2_zlib_init(void)
if (WORKSPACESIZE < zlib_deflate_workspacesize())
if (WORKSPACESIZE < zlib_inflate_workspacesize())
In a second patch, it would be possible to fold those two workspaces
into one and save a little memory as well.
They laughed at Galileo. They laughed at Copernicus. They laughed at
Columbus. But remember, they also laughed at Bozo the Clown.
More information about the linux-mtd