]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ext4: check for a good block group before loading buddy pages
authorCurt Wohlgemuth <curtw@google.com>
Mon, 31 May 2010 02:49:58 +0000 (22:49 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 2 Aug 2010 17:21:22 +0000 (10:21 -0700)
commitf6784b3b11fb38c1f3f4be686720b022babfd1e8
tree5fe046b6f843f564ec58572fba56fa75c7d4285f
parent0a27a9e513fa9a229745fe94e42b020f66a7ec10
ext4: check for a good block group before loading buddy pages

commit 8a57d9d61a6e361c7bb159dda797672c1df1a691 upstream (as of v2.6.34-git13)

This adds a new field in ext4_group_info to cache the largest available
block range in a block group; and don't load the buddy pages until *after*
we've done a sanity check on the block group.

With large allocation requests (e.g., fallocate(), 8MiB) and relatively full
partitions, it's easy to have no block groups with a block extent large
enough to satisfy the input request length.  This currently causes the loop
during cr == 0 in ext4_mb_regular_allocator() to load the buddy bitmap pages
for EVERY block group.  That can be a lot of pages.  The patch below allows
us to call ext4_mb_good_group() BEFORE we load the buddy pages (although we
have check again after we lock the block group).

Addresses-Google-Bug: #2578108
Addresses-Google-Bug: #2704453

Signed-off-by: Curt Wohlgemuth <curtw@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/ext4/ext4.h
fs/ext4/mballoc.c