linux/fs/ext4
Lukas Czerner bfff68738f ext4: add support for lazy inode table initialization
When the lazy_itable_init extended option is passed to mke2fs, it
considerably speeds up filesystem creation because inode tables are
not zeroed out.  The fact that parts of the inode table are
uninitialized is not a problem so long as the block group descriptors,
which contain information regarding how much of the inode table has
been initialized, has not been corrupted However, if the block group
checksums are not valid, e2fsck must scan the entire inode table, and
the the old, uninitialized data could potentially cause e2fsck to
report false problems.

Hence, it is important for the inode tables to be initialized as soon
as possble.  This commit adds this feature so that mke2fs can safely
use the lazy inode table initialization feature to speed up formatting
file systems.

This is done via a new new kernel thread called ext4lazyinit, which is
created on demand and destroyed, when it is no longer needed.  There
is only one thread for all ext4 filesystems in the system. When the
first filesystem with inititable mount option is mounted, ext4lazyinit
thread is created, then the filesystem can register its request in the
request list.

This thread then walks through the list of requests picking up
scheduled requests and invoking ext4_init_inode_table(). Next schedule
time for the request is computed by multiplying the time it took to
zero out last inode table with wait multiplier, which can be set with
the (init_itable=n) mount option (default is 10).  We are doing
this so we do not take the whole I/O bandwidth. When the thread is no
longer necessary (request list is empty) it frees the appropriate
structures and exits (and can be created later later by another
filesystem).

We do not disturb regular inode allocations in any way, it just do not
care whether the inode table is, or is not zeroed. But when zeroing, we
have to skip used inodes, obviously. Also we should prevent new inode
allocations from the group, while zeroing is on the way. For that we
take write alloc_sem lock in ext4_init_inode_table() and read alloc_sem
in the ext4_claim_inode, so when we are unlucky and allocator hits the
group which is currently being zeroed, it just has to wait.

This can be suppresed using the mount option no_init_itable.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-10-27 21:30:05 -04:00
..
Kconfig ext4: Don't ask about supporting ext2/3 in ext4 if ext4 is not configured 2009-12-21 10:54:09 -05:00
Makefile ext4: online defrag -- Add EXT4_IOC_MOVE_EXT ioctl 2009-06-17 19:24:03 -04:00
acl.c ext4: update ctime when changing the file's permission by setfacl 2010-06-15 12:19:59 -04:00
acl.h ext[234]: move over to 'check_acl' permission model 2009-09-08 11:09:04 -07:00
balloc.c ext4: Clean up s_dirt handling 2010-06-11 23:14:04 -04:00
bitmap.c ext4: Change unsigned long to unsigned int 2008-11-05 00:14:04 -05:00
block_validity.c ext4: Save error information to the superblock for analysis 2010-07-27 11:56:03 -04:00
dir.c ext4: Remove unnecessary casts of private_data 2010-07-27 11:56:04 -04:00
ext4.h ext4: add support for lazy inode table initialization 2010-10-27 21:30:05 -04:00
ext4_extents.h ext4: Calculate metadata requirements more accurately 2010-01-01 02:41:30 -05:00
ext4_jbd2.c ext4: Pass line numbers to ext4_error() and friends 2010-07-27 11:56:40 -04:00
ext4_jbd2.h ext4: Pass line numbers to ext4_error() and friends 2010-07-27 11:56:40 -04:00
extents.c ext4: fix EOFBLOCKS_FL handling 2010-10-27 21:23:12 -04:00
file.c ext4: fix EFBIG edge case when writing to large non-extent file 2010-07-27 11:56:07 -04:00
fsync.c rename the generic fsync implementations 2010-05-27 22:06:06 -04:00
hash.c ext4: Add support for non-native signed/unsigned htree hash algorithms 2008-10-28 13:21:44 -04:00
ialloc.c ext4: add support for lazy inode table initialization 2010-10-27 21:30:05 -04:00
inode.c ext4: don't bump up LONG_MAX nr_to_write by a factor of 8 2010-10-27 21:30:03 -04:00
ioctl.c ext4: Drop whitespace at end of lines 2010-05-17 07:00:00 -04:00
mballoc.c ext4: don't hold spinlock while calling ext4_issue_discard() 2010-10-27 21:30:04 -04:00
mballoc.h ext4: consolidate in_range() definitions 2010-03-03 23:55:01 -05:00
migrate.c ext4: Convert more i_flags references to use accessor functions 2010-06-14 09:54:48 -04:00
move_extent.c ext4: Pass line numbers to ext4_error() and friends 2010-07-27 11:56:40 -04:00
namei.c ext4: re-inline ext4_rec_len_(to|from)_disk functions 2010-08-05 01:46:37 -04:00
resize.c ext4: remove initialized but not read variables 2010-06-14 13:28:03 -04:00
super.c ext4: add support for lazy inode table initialization 2010-10-27 21:30:05 -04:00
symlink.c ext4: symlink must be handled via filesystem specific operation 2010-05-16 02:00:00 -04:00
xattr.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6 2010-08-10 11:26:52 -07:00
xattr.h ext4: constify xattr_handler 2010-05-21 18:31:19 -04:00
xattr_security.c ext4: constify xattr_handler 2010-05-21 18:31:19 -04:00
xattr_trusted.c ext4: constify xattr_handler 2010-05-21 18:31:19 -04:00
xattr_user.c ext4: constify xattr_handler 2010-05-21 18:31:19 -04:00