]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: don't allocate chunks as aggressively
authorJosef Bacik <josef@redhat.com>
Fri, 15 Oct 2010 19:23:48 +0000 (15:23 -0400)
committerJosef Bacik <josef@redhat.com>
Fri, 22 Oct 2010 19:55:00 +0000 (15:55 -0400)
commitf1d78363a7ea006b7fb5f07a224bc4c821c3618b
tree1477718d4ab61c258c2a514afec5bfc36e89acf7
parent1a5211c1a674064343dee4120c9402a4210ed9f5
Btrfs: don't allocate chunks as aggressively

Because the ENOSPC code over reserves super aggressively we end up allocating
chunks way more often than we should.  For example with my fs_mark tests on a
2gb fs I can end up reserved 1gb just for metadata, when only 34mb of that is
being used.  So instead check to see if the amount of space actually used is
less than 30% of the total space, and if so don't allocate a chunk, but only if
we have at least 256mb of free space to make sure we don't put too much pressure
on free space.

Signed-off-by: Josef Bacik <josef@redhat.com>
fs/btrfs/extent-tree.c