diff options
author | Miao Xie <miaox@cn.fujitsu.com> | 2013-09-09 07:19:42 +0200 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2013-09-21 17:05:23 +0200 |
commit | a482039889b85c45fc9616e65d560db7a35d4f54 (patch) | |
tree | 58482aa49aa50c30cdd2e7b496f30dd1c11ac860 /fs/ubifs/tnc_commit.c | |
parent | btrfs: add lockdep and tracing annotations for uuid tree (diff) | |
download | linux-a482039889b85c45fc9616e65d560db7a35d4f54.tar.xz linux-a482039889b85c45fc9616e65d560db7a35d4f54.zip |
Btrfs: allocate the free space by the existed max extent size when ENOSPC
By the current code, if the requested size is very large, and all the extents
in the free space cache are small, we will waste lots of the cpu time to cut
the requested size in half and search the cache again and again until it gets
down to the size the allocator can return. In fact, we can know the max extent
size in the cache after the first search, so we needn't cut the size in half
repeatedly, and just use the max extent size directly. This way can save
lots of cpu time and make the performance grow up when there are only fragments
in the free space cache.
According to my test, if there are only 4KB free space extents in the fs,
and the total size of those extents are 256MB, we can reduce the execute
time of the following test from 5.4s to 1.4s.
dd if=/dev/zero of=<testfile> bs=1MB count=1 oflag=sync
Changelog v2 -> v3:
- fix the problem that we skip the block group with the space which is
less than we need.
Changelog v1 -> v2:
- address the problem that we return a wrong start position when searching
the free space in a bitmap.
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/ubifs/tnc_commit.c')
0 files changed, 0 insertions, 0 deletions