jffs zlib tuning

David Woodhouse dwmw2 at infradead.org
Tue Jan 8 04:08:15 EST 2008


On Mon, 2008-01-07 at 18:15 +0100, NoiseEHC wrote:
> This message is primarily written for Bernardo Innocenti but everybody 
> with relevant knowledge is welcomed to give some insight.
> 
> I have decided two months ago that will write an asm implementation for 
> zlib inflate (decompression) since Mitch Bradley said that the read 
> speed is 3MB/sec which is dominated by the decompression code.
> http://lists.laptop.org/pipermail/devel/2007-November/007527.html
> 
> 
> Since then I went through the pain of installing linux in VirtualPC, 
> compiling the code in linux and ended up with a kernel module which can 
> test zlib code finally (took a month of my spare time, if I would have 
> known this in advance I would not have started...). Now I understand the 
> zlib code but need some info before acting on wrong assumptions:
> 
> 1. Did anybody profile the kernel while reading files? Last thing I red 
> on this list is that the profiler does not work on the XO in kernel 
> mode. Did anybody fix that

I believe that standard kernel profiling (on timer ticks) has always
worked, and even continues to work even though we use a tickless kernel
now. I think oprofile also works.

> 2. How does the file reading work? As I imagine the flash is read by DMA 
> and the resulting data is uncompressed to a buffer. Is it correct?. 

Yes, that's right.

> Is the decompressed data gets copied to the target location or does it gets 
> decompressed to their final place? 

http://dev.laptop.org/git?p=olpc-2.6;a=blob;f=fs/jffs2/read.c#l81

> If it is copied, did somebody profile how much time it takes? These
> questions are important to know how much L2 cache is trashed in the
> process and which data needs prefetching.

That hasn't been profiled specifically, no.

> 3. How long is the average data length which jffs2 uses for calling inflate?

The maximum length of uncompressed data is 4KiB. The mean is probably
slightly less than that. You could instrument the jffs2dump program from
mtd-utils to give you more accurate answers.

If you want to get involved with compression, see
http://www.inf.u-szeged.hu/jffs2/bbc.php

-- 
dwmw2




More information about the Devel mailing list