WSL2-Linux-Kernel/fs/ext4
Theodore Ts'o 40ae348762 ext4: optimize mballoc for large allocations
The ext4 block allocator only maintains buddy bitmaps for chunks which
are less than or equal to one quarter of a block group.  That is, for
a file aystem with a 1k blocksize, and where the number of blocks in a
block group is 8192 blocks, the largest chunk size tracked by buddy
bitmaps is 2048 blocks.

For a file system with a 4k blocksize, and where the number of blocks
in a block group is 32768 blocks, the largest chunk size tracked by
buddy bitmaps is 8192 blocks.

To work around this code, mballoc.c before this commit would truncate
allocation requests to the number of blocks in a block group minus 10.
Why 10?  Aside from being a completely arbitrary number, it avoids
block allocation to be a power of two larger than 25% of the block
group.  If you try to explicitly fallocate 50% of the block group
size, this will demonstrate the problem; the block allocation code
will scan the all of the blocks in the file system with cr==0 (since
the request is for a natural power of two), but then completely fail
for all blocks groups, since the buddy bitmaps don't track chunk sizes
of 50% of the block group.

To fix this, in these we use ext4_mb_complex_scan_group() instead of
ext4_mb_simple_scan_group().

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: Andreas Dilger <adilger@dilger.ca>
2013-02-04 15:08:40 -05:00
..
Kconfig ext4: fix configuration dependencies for ext4 ACLs and security labels 2013-01-06 23:38:44 -05:00
Makefile ext4: Remove CONFIG_EXT4_FS_XATTR 2012-12-10 16:30:43 -05:00
acl.c ext4: fix memory leak in ext4_xattr_set_acl()'s error path 2012-11-08 15:11:11 -05:00
acl.h fs: take the ACL checks to common code 2011-07-25 14:30:23 -04:00
balloc.c ext4: check bh in ext4_read_block_bitmap() 2013-01-12 16:33:25 -05:00
bitmap.c ext4: Checksum the block bitmap properly with bigalloc enabled 2012-10-22 00:34:32 -04:00
block_validity.c ext2/3/4: delete unneeded includes of module.h 2012-01-09 13:52:10 +01:00
dir.c ext4: release buffer when checksum failed 2013-01-28 21:23:24 -05:00
ext4.h ext4: move work from io_end to inode 2013-01-28 09:43:46 -05:00
ext4_extents.h ext4: rationalize ext4_extents.h inclusion 2012-11-28 13:03:30 -05:00
ext4_jbd2.c ext4: fix metadata checksum calculation for the superblock 2012-10-10 01:06:58 -04:00
ext4_jbd2.h ext4: remove ext4_handle_release_buffer() 2012-11-08 11:22:46 -05:00
extents.c ext4: remove explicit WARN_ON when ext4_map_blocks() fails 2013-01-28 21:21:12 -05:00
extents_status.c ext4: add some tracepoints in extent status tree 2012-11-08 21:57:33 -05:00
extents_status.h ext4: add operations on extent status tree 2012-11-08 21:57:20 -05:00
file.c Various bug fixes for ext4. Perhaps the most serious bug fixed is one 2013-01-02 09:57:34 -08:00
fsync.c ext4: fix an incorrect comment about i_mutex 2012-12-25 13:31:52 -05:00
hash.c ext4: reduce one "if" comparison in ext4_dirhash() 2013-02-01 22:33:21 -05:00
ialloc.c ext4: enable ext4 inline support 2012-12-10 14:06:03 -05:00
indirect.c ext4: use WARN in ext4_alloc_blocks 2013-02-01 20:07:21 -05:00
inline.c ext4: return ENOMEM if sb_getblk() fails 2013-01-12 16:19:36 -05:00
inode.c ext4: fix possible use-after-free with AIO 2013-01-29 22:48:17 -05:00
ioctl.c ext4: trigger the lazy inode table initialization after resize 2013-01-13 08:41:45 -05:00
mballoc.c ext4: optimize mballoc for large allocations 2013-02-04 15:08:40 -05:00
mballoc.h ext4: remove unused macro MB_DEFAULT_MAX_GROUPS_TO_SCAN 2012-08-17 10:00:17 -04:00
migrate.c ext4: rationalize ext4_extents.h inclusion 2012-11-28 13:03:30 -05:00
mmp.c ext4: use unlikely to improve the efficiency of the kernel 2013-01-12 16:28:47 -05:00
move_extent.c ext4: fix smatch warning in move_extent.c's mext_replace_branches() 2013-02-01 20:52:46 -05:00
namei.c ext4: remove unnecessary NULL pointer check 2013-01-28 21:41:02 -05:00
page-io.c ext4: fix possible use-after-free with AIO 2013-01-29 22:48:17 -05:00
resize.c ext4: trigger the lazy inode table initialization after resize 2013-01-13 08:41:45 -05:00
super.c ext4: check incompatible mount options while mounting ext2/3 2013-02-02 23:38:39 -05:00
symlink.c ext4: Remove CONFIG_EXT4_FS_XATTR 2012-12-10 16:30:43 -05:00
truncate.h ext4: move common truncate functions to header file 2011-06-27 19:16:04 -04:00
xattr.c ext4: use unlikely to improve the efficiency of the kernel 2013-01-12 16:28:47 -05:00
xattr.h ext4: zero out inline data using memset() instead of empty_zero_page 2012-12-11 03:31:49 -05:00
xattr_security.c Merge branch 'for_linus' into for_linus_merged 2012-01-10 11:54:07 -05:00
xattr_trusted.c ext2/3/4: delete unneeded includes of module.h 2012-01-09 13:52:10 +01:00
xattr_user.c ext2/3/4: delete unneeded includes of module.h 2012-01-09 13:52:10 +01:00