ffs_alloc.c: minfree Q

Dmitry Morozovsky marck at rinet.ru
Wed Aug 10 10:02:03 GMT 2005


Colleagues,


from ffs_alloc.c:

        case FS_OPTSPACE:
                /*
                 * Allocate an exact sized fragment. Although this makes
                 * best use of space, we will waste time relocating it if
                 * the file continues to grow. If the fragmentation is
                 * less than half of the minimum free reserve, we choose
                 * to begin optimizing for time.
                 */
                request = nsize;
                if (fs->fs_minfree <= 5 ||
   --->>>        ~~~~~~~~~~~~~~~~~~~~~~
                    fs->fs_cstotal.cs_nffree >
                    (off_t)fs->fs_dsize * fs->fs_minfree / (2 * 100))
                        break;
                log(LOG_NOTICE, "%s: optimization changed from SPACE to TIME\n",
                        fs->fs_fsmnt);
                fs->fs_optim = FS_OPTTIME;
                break;

For contemporary situation, where total size of file system can grow to 
hundreds of Gs or even several Ts, 8% of space seems too high. 

Maybe this algorithm should be slightly adjusted (I'm thinking of logarithmic 
scale depending on file system size)? 

Any (contemporary) references would be highly appreciated.


Sincerely,
D.Marck                                     [DM5020, MCK-RIPE, DM3-RIPN]
------------------------------------------------------------------------
*** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck at rinet.ru ***
------------------------------------------------------------------------


More information about the freebsd-hackers mailing list