freebsd-dev/sys/ufs/ffs
Kirk McKusick 4de0d16b8c For traditional disks, the filesystem attempts to allocate the
blocks of a file as contiguously as possible. Since the filesystem
does not know how large a file will grow when it is first being
written, it initially places the file in a set of blocks in which
it currently fits. As it grows, it is relocated to areas with
larger contiguous blocks.  In this way it saves its large contiguous
sets of blocks for the files that need them and thus avoids
unnecessaily fragmenting its disk space.

We used to skip reallocating the blocks of a file into a contiguous
sequence if the underlying flash device requested BIO_DELETE
notifications, because devices that benefit from BIO_DELETE also
benefit from not moving the data. However, in the algorithm described
above that reallocates the blocks, the destination for the data is
usually moved before the data is written to the initially allocated
location. So we rarely suffer the penalty of extra writes.  With
the addition of the consolodation of contiguous blocks into single
BIO_DELETE operations, having fewer but larger contiguous blocks
reduces the number of (slow and expensive) BIO_DELETE operations.
So when doing BIO_DELETE consolodation, we do block reallocation.

Reviewed by:  kib
Tested by:    Peter Holm
Sponsored by: Netflix
2018-08-19 17:19:20 +00:00
..
ffs_alloc.c For traditional disks, the filesystem attempts to allocate the 2018-08-19 17:19:20 +00:00
ffs_balloc.c Replace the TRIM consolodation framework originally added in -r337396 2018-08-18 22:21:59 +00:00
ffs_extern.h Replace the TRIM consolodation framework originally added in -r337396 2018-08-18 22:21:59 +00:00
ffs_inode.c Replace the TRIM consolodation framework originally added in -r337396 2018-08-18 22:21:59 +00:00
ffs_rawread.c sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
ffs_snapshot.c Replace the TRIM consolodation framework originally added in -r337396 2018-08-18 22:21:59 +00:00
ffs_softdep.c Replace the TRIM consolodation framework originally added in -r337396 2018-08-18 22:21:59 +00:00
ffs_subr.c Import commit from NetBSD with checkin message: 2018-07-07 19:11:43 +00:00
ffs_suspend.c Avoid assertion in /dev/ufssuspend when the suspend ioctl is 2018-08-01 19:06:55 +00:00
ffs_tables.c sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
ffs_vfsops.c Replace the TRIM consolodation framework originally added in -r337396 2018-08-18 22:21:59 +00:00
ffs_vnops.c ffs_syncvnode: Remove unhelpful print 2018-07-14 15:45:11 +00:00
fs.h The goal of this change is to prevent accidental foot shooting by 2018-02-08 23:06:58 +00:00
softdep.h Replace the TRIM consolodation framework originally added in -r337396 2018-08-18 22:21:59 +00:00