diff options
author | mckusick <mckusick@FreeBSD.org> | 2013-03-22 21:45:28 +0000 |
---|---|---|
committer | mckusick <mckusick@FreeBSD.org> | 2013-03-22 21:45:28 +0000 |
commit | be2f56b8d7746e3a931d3f607c34cf88e72f901b (patch) | |
tree | 4dd79ec73ca7a215a3694baba70bbfe162604d09 /sys/ufs/ffs/fs.h | |
parent | 82edd7c36328fd70dad3a7c7b7e7f8de433ce40b (diff) | |
download | FreeBSD-src-be2f56b8d7746e3a931d3f607c34cf88e72f901b.zip FreeBSD-src-be2f56b8d7746e3a931d3f607c34cf88e72f901b.tar.gz |
The purpose of this change to the FFS layout policy is to reduce the
running time for a full fsck. It also reduces the random access time
for large files and speeds the traversal time for directory tree walks.
The key idea is to reserve a small area in each cylinder group
immediately following the inode blocks for the use of metadata,
specifically indirect blocks and directory contents. The new policy
is to preferentially place metadata in the metadata area and
everything else in the blocks that follow the metadata area.
The size of this area can be set when creating a filesystem using
newfs(8) or changed in an existing filesystem using tunefs(8).
Both utilities use the `-k held-for-metadata-blocks' option to
specify the amount of space to be held for metadata blocks in each
cylinder group. By default, newfs(8) sets this area to half of
minfree (typically 4% of the data area).
This work was inspired by a paper presented at Usenix's FAST '13:
www.usenix.org/conference/fast13/ffsck-fast-file-system-checker
Details of this implementation appears in the April 2013 of ;login:
www.usenix.org/publications/login/april-2013-volume-38-number-2.
A copy of the April 2013 ;login: paper can also be downloaded
from: www.mckusick.com/publications/faster_fsck.pdf.
Reviewed by: kib
Tested by: Peter Holm
MFC after: 4 weeks
Diffstat (limited to 'sys/ufs/ffs/fs.h')
-rw-r--r-- | sys/ufs/ffs/fs.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/ufs/ffs/fs.h b/sys/ufs/ffs/fs.h index b62a808..b154a80 100644 --- a/sys/ufs/ffs/fs.h +++ b/sys/ufs/ffs/fs.h @@ -333,7 +333,8 @@ struct fs { int32_t fs_maxbsize; /* maximum blocking factor permitted */ int64_t fs_unrefs; /* number of unreferenced inodes */ int64_t fs_providersize; /* size of underlying GEOM provider */ - int64_t fs_sparecon64[15]; /* old rotation block list head */ + int64_t fs_metaspace; /* size of area reserved for metadata */ + int64_t fs_sparecon64[14]; /* old rotation block list head */ int64_t fs_sblockloc; /* byte offset of standard superblock */ struct csum_total fs_cstotal; /* (u) cylinder summary information */ ufs_time_t fs_time; /* last time written */ @@ -525,6 +526,8 @@ struct cg { * They calc filesystem addresses of cylinder group data structures. */ #define cgbase(fs, c) (((ufs2_daddr_t)(fs)->fs_fpg) * (c)) +#define cgdata(fs, c) (cgdmin(fs, c) + (fs)->fs_metaspace) /* data zone */ +#define cgmeta(fs, c) (cgdmin(fs, c)) /* meta data */ #define cgdmin(fs, c) (cgstart(fs, c) + (fs)->fs_dblkno) /* 1st data */ #define cgimin(fs, c) (cgstart(fs, c) + (fs)->fs_iblkno) /* inode blk */ #define cgsblock(fs, c) (cgstart(fs, c) + (fs)->fs_sblkno) /* super blk */ |