Re: [PATCH RFC] 1/2 central workspace for zlib

From: matsunaga (
Date: Mon Jun 02 2003 - 10:15:56 EST

> 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.


Thank you for the patch.
It definitely reduces resources and improve multiple CPU scalability.

But I still would like to stick to performance.
(Though I haven't evaluated the performance yet...)
So far I think MTD is used mostly on Embedded device,
in which single CPU which is not so powerful is used.

How is the following code (it is ugly though)?

static void default_workspace[WSIZE];


    size = MAX(sizeof(struct inflate_workspace),
        sizeof(struct deflate_workspace));

    if(WSIZE < size)

    zlib_workspace[0] = default_workspace;

    for (i=1; i<smp_num_cpus; i++) {
        zlib_workspace[i] = vmalloc(size);
        if (!zlib_workspace[i]) {
            return -ENOMEM;

There is another vmalloc in mtdblock_open()...;-)

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Sat Jun 07 2003 - 22:00:17 EST