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

From: matsunaga (matsunaga_kazuhisa@yahoo.co.jp)
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.

Hi

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];

<snip>

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

    if(WSIZE < size)
        BUG();

    zlib_workspace[0] = default_workspace;

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

P.S.
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 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/



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