]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: don't force chunk allocation in find_free_extent
authorChris Mason <chris.mason@oracle.com>
Fri, 15 Apr 2011 20:05:44 +0000 (16:05 -0400)
committerChris Mason <chris.mason@oracle.com>
Fri, 15 Apr 2011 20:05:44 +0000 (16:05 -0400)
commite94e7406135270d9079914aae55e6c4c019642cc
treecc43a4a6ff229a84f26376f27d9d938ac4dc1b26
parent1f5e209175ec2c59f629be0be02b31f749df98a2
Btrfs: don't force chunk allocation in find_free_extent

find_free_extent likes to allocate in contiguous clusters,
which makes writeback faster, especially on SSD storage.  As
the FS fragments, these clusters become harder to find and we have
to decide between allocating a new chunk to make more clusters
or giving up on the cluster to allocate from the free space
we have.

Right now it creates too many chunks, and you can end up with
a whole FS that is mostly empty metadata chunks.  This commit
changes the allocation code to be more strict and only
allocate new chunks when we've made good use of the chunks we
already have.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/extent-tree.c