minix3 filesystem implementation
I was just going through section 5.3 of Operating Systems: Design and Implementation: "File system implementation", and I have a doubt regarding disk management using linked lists (table implementation).
The authors mention that using the table implementation takes up 3 bytes per table 开发者_运维百科entry, and this is understandable. However, it is also mentioned that an optimization for time can be performed by using 4 bytes per table entry.
How does that optimization work?
Perhaps 4 bytes is the word size of the architecture, so the CPU can immediately do arithmetic with those values? With 3 byte values, you presumably need to do some bit twiddling to expand them to 4 bytes before you can operate on the values.
That being said, CPU's are very very fast compared to memory, not to mention disk, bandwidth, so I wouldn't be surprised if the 3 byte version is faster in practice.
精彩评论