[Yaffs] Tnode tallness (trading memory for nand reads)

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Brad Beveridge
Date:  
To: yaffs
Subject: [Yaffs] Tnode tallness (trading memory for nand reads)
Hi all, I've been taking a bit of a look through the yaffs source code,
in particular looking at the Tnode structures. If I am understanding it
correctly, when yaffs needs to find a chunk in nand,
yaffs_FindChunkInFile is called which walks the tnode structure until it
hits the leaf nodes, and then scans up to dev->chunkGroupSize spare
areas to find the correct chunk. I'm not sure, but I think that
chunkGroupSize could be up to a whole block. From our quick analysis,
reading these spare areas to find the correct chunk is taking quite a
hit on our read performance (ie, we expect ~7Mb/s, but are getting
closer to 2Mb/s)
I have a couple of questions
1) How easy is it to trade memory space for nand reads in this case?
Ie, can we reduce the number of nand reads that are required to find the
right chunk. In our particular system where memory is plentiful, we
would like to find the correct chunk first time every time without
having to (slowly) read the nand.
2) Is it worth trying to optimise for the usual read case? I expect
that the usual read case would be to read more than 1 chunk sized area,
so perhaps Yaffs should remember where the last chunk resided, and on
the next chunk read - if the Tnode leaf is the same - check the next
sequential chunk to see if it is the correct one.

Thanks for any comments.

Cheers
Brad