tech-kern archive

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

Re: blocksizes

On Mon, Feb 01, 2010 at 07:48:01PM -0500, Thor Lancelot Simon wrote:
> On Mon, Feb 01, 2010 at 10:59:37PM +0000, Michael van Elst wrote:
> > 
> > It still wouldn't be perfect. Block size is one thing, block alignment
> > the next. A filesystem with 1k blocks (filesystem units == clusters)
> > has problems to work on disks with 2k blocks (device units == sectors).
> > The only solution is expensive buffering and read-modify-write updates.
> Aren't we in fact going to run into this with 512-byte FFS fragments
> and disks with 4K sectors?

Yes. FFS with 512-byte fragments and 4K sectors simply does not work.
There is no code that handles this and it would be slow anyway.

Fragments must be at least as large a disk sector.

That already happens almost automatically because of newfs defaults:

  file system size  frag-size
  < 20 MB           0.5 KB
  < 1024 MB         1 KB
  >= 1024 MB        2 KB

Maybe there should be another level (1TB?) that choses 4K fragments
(and 32KB blocks) by default but newfs will already refuse to create
a filesystem with fragments (or blocks) smaller than sectors.

And then there is the 64K MAXPHYS limit on the other end.

                                Michael van Elst
                                "A potential Snark may lurk in every tree."

Home | Main Index | Thread Index | Old Index