Re: [RFC][PATCH] ChunkFS: fs fission for faster fsck

Jörn Engel
2007-04-28T10:07:49Z

On Fri, 27 April 2007 23:50:06 -0700, Valerie Henson wrote:
>
> Any mapping structure will have to be pre-allocated.

How much space would you allocate for it then? The required size surely
depends on the file size and fragmentation.

> So in my secret heart of hearts, I do indeed hope that cnodes are rare
> enough that we don't actually have to do anything smart to make them
> go fast. Either having no fast lookup structure or creating it in
> memory as needed would be the nicest solution. However, since I can't
> guarantee this will be the case, it's nice to have some idea of what
> we'll do if this does become important.

You go slow and slower. Or you can defragment/clean the filesystem.
Fragmented filesystems being slow is hardly news to anyone. ChunkFS
will be slower than others, so the reasons to fight fragmentation weigh
heavier.

What you can do:
- If two files 1 and 2 contain blocks in chunks A and B, move file 1
blocks to chunk A and file 2 blocks to chunk B until one of the files
only spans a single chunk.
- Same as above with longer chains like file 1 in chunks (A,B), file 2
in chunks (B,C), file 3 in chunks (A,C).
- When writing to file 1 in chunk A but running out of space in chunk A,
move some cross-chunk file over instead of writing file 1 blocks to
chunk B.

The first two can hope to use some idle times (if they exist), the third
will make writes go slower in order to speed up future reads.

There ain't no such thing as a free lunch. :)

Jörn

--
I can say that I spend most of my time fixing bugs even if I have lots
of new features to implement in mind, but I give bugs more priority.
-- Andrea Arcangeli, 2000