tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: choosing the file system block size



>> at least if you ignore the space used by the inode.
> I guess I can indeed ignore inodes because the space occupied by them
> doesn't vary with fsbsize, or does it?

I think you're right that an inode's size is independent of the
filesystem's blocksize; possibly also relevant is that inode space is
not available for ordinary data storage even if the inodes in question
are not being used.  (Whether these means you can ignore them depends
on exactly what you care about; you know that better than I.)

>> For files large enough to need indirect blocks,
>> (a) the size is rounded up to the block size, not the frag size,
> Oops, I didn't know that.

Also, it has to occupy only whole blocks.  (This can lead to an
out-of-space error while there is still space on the disk, if all the
available space is in sub-block fragments but the file being extended
is large enough that it uses only whole blocks.  I have a fuzzy memory
that there's code in the allocation routines that tries to allocate
fragments out of sub-block pieces rather than splitting whole blocks,
in an attempt to reduce this effect.)

>> and (b) you also need to account for indirect blocks.
> Ah, yes. Although that's probably negledgible

Again, it depends on your purpose.  It is a fairly small fraction,
though; even at its most egregious - a 512/512 filesystem - single
indirect block overhead adds 1/128 (128 = 512/4), double indirect adds
1/16384 above the single indirect overhead, and triple another
1/2097152 above that.  More typical would be, say, a 1k/8k filesystem,
for which the fractions are 1/2048 (2048 = 8192/4), double 1/4194304,
and triple 1/8589934592.  (This is for FFSv1.  I think FFSv2 has 64-bit
block addresses, in which case those fractions increase - 1/64, 1/4096,
and 1/262144 for 512; 1/1024, 1/1048576, and 1/1073741824 for 8k.)

/~\ The ASCII                             Mouse
\ / Ribbon Campaign
 X  Against HTML                mouse%rodents-montreal.org@localhost
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index