|
About ::
TODO ::
Blog ::
RSS ::
Old blog ::
Projects ::
GIT ::
Gallery ::
Notes
Tue, 14 Nov 2006
Delayed allocation and fragmentation. Essentially, delaying the disk allocation until a file is large/complete (delalloc) and then using a buddy allocator in memory to get contiguous chunks of disk is better than hard 64K+ cluster because it avoids internal fragmentation and allows much more optimal/efficient placement than just a factor of 16 reduction in the block count.This completely confirms my thoughts about delayed allocation. But I want to add even more - log-structured file system, i.e. file systems, which allows to write updated block essentialy everywhere on the disk instead of the place where previous one was placed, have self-defragmentation mechanism by design - there is no need to reallocate inodes and move files all over the disk - new version can be put in new location, which can be carefully selected and can be written together with unupdated part thus removing fragmentation. Journaling filesystems require defragmentator for that task. /devel/fs :: Link / Comments (0)
Why trees are better than binary search.
if (in->min < new->min) {
netchannel_interval_split(in, in->min, new->min-1, GFP_KERNEL);
if (in->max > new->max) {
netchannel_interval_split(NULL, new->min, new->max, GFP_KERNEL);
netchannel_interval_split(new, new->max+1, in->max, GFP_KERNEL);
} else if (in->max < new->max) {
netchannel_interval_split(NULL, new->min, in->max, GFP_KERNEL);
netchannel_interval_split(new, in->max+1, new->max, GFP_KERNEL);
} else {
netchannel_interval_split(new, new->min, in->max, GFP_KERNEL);
}
} else if (in->min > new->min) {
netchannel_interval_split(in, new->min, in->min-1, GFP_KERNEL);
if (in->max > new->max) {
netchannel_interval_split(NULL, in->min, new->max, GFP_KERNEL);
netchannel_interval_split(new, new->max+1, in->max, GFP_KERNEL);
} else if (in->max < new->max) {
netchannel_interval_split(NULL, in->min, in->max, GFP_KERNEL);
netchannel_interval_split(new, in->max+1, new->max, GFP_KERNEL);
} else {
netchannel_interval_split(new, in->min, new->max, GFP_KERNEL);
}
} else {
if (in->max > new->max) {
netchannel_interval_split(in, in->min, new->max, GFP_KERNEL);
netchannel_interval_split(new, new->max+1, in->max, GFP_KERNEL);
} else if (in->max < new->max) {
netchannel_interval_split(in, in->min, in->max, GFP_KERNEL);
netchannel_interval_split(new, in->max+1, new->max, GFP_KERNEL);
} else {
netchannel_interval_split(in, in->min, in->max, GFP_KERNEL);
}
}
I think my head will be broken in a couple of moments...Tricky algorithm should be used there probably to split them up, but I currently fail to research one, so I use stupid but the fastest - there are only two checks and one allocation (or two if new interval was allocated in stack) for the worst case of crossing, when two crossed intervals are put into three non-crossing ones. /devel/networking :: Link / Comments (0)
Filesystem stress testing and emulation tool. /devel/fs :: Link / Comments (0)
Do you know what Google Earth lacks at the first place? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||