]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix the confusion between delalloc bytes and metadata bytes
authorMiao Xie <miaox@cn.fujitsu.com>
Mon, 4 Nov 2013 15:13:23 +0000 (23:13 +0800)
committerChris Mason <chris.mason@fusionio.com>
Tue, 12 Nov 2013 03:13:30 +0000 (22:13 -0500)
commitb5d76f3c7ae7fe5f0bc4e52284a71f11bbcf54f1
treeaf5c567b539c9d368e270bd85bd3e8159fecfeea
parent65e5be921227418303adb88ff0228cfef3349c03
Btrfs: fix the confusion between delalloc bytes and metadata bytes

In shrink_delalloc(), what we need reclaim is the metadata space, so
flushing pages by to_reclaim is not reasonable, it is very likely that
the pages we flush are not enough. And then we had to invoke the flush
function for several times, at the worst, we need call flush_space for
several times. It wasted time.

We improve this problem by converting the metadata space size we need
reserve to the delalloc bytes, By this way, we can flush the pages
by a reasonable number.

(Now we use a fixed number to do conversion, it is not flexible, maybe
 we can find a good way to improve it in the future.)

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>
fs/btrfs/extent-tree.c