So, in this case in ARM sizeof pointer would be 4 B (in 64-bit system even greater) which gives sizeof(struct yaffs_tnode) = 32 B. In yaffs_allocator.c in function yaffs_create_tnodes() 100 tnodes are allocated at a time and there the memory allocation size is = n_tnodes * dev->tnode_size = 100*32 = 3.2K for only 100 tnodes (here, according to the post above I would expect 100*20 bit = 250When we look at source code at yaffs_guts_initialise() where the tnode size is set we can see:Hello,I was reading this post ( http://www.yaffs.net/lurker/message/20090812.040040.5e77b55f.en.html ) regarding the tnode size and RAM usage by the tnodes and have been confused.
dev->tnode_size = (dev->tnode_width * YAFFS_NTNODES_LEVEL0) / 8;
if (dev->tnode_size < sizeof(struct yaffs_tnode))
dev->tnode_size = sizeof(struct yaffs_tnode);
Byte of RAM). In the post above it was stated that for 524288 chunks it was needed 20 bits to represent each of them, but in code we can see that it is needed at least 32 B = 26 bits for each tnode irrespective of the bits needed to represent each tnode. Could you explain it to me, how much memory is needed for a tnode? Would it be possible to decrease RAM usage by decreasing YAFFS_NTNODES_LEVEL0 and other relevant constants or is tnode size irrespective of that always at least sizeof(struct yaffs_tnode)?
Regards,Shuhrat Rahimov
_______________________________________________
yaffs mailing list
yaffs@stoneboat.aleph1.co.uk
http://stoneboat.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs