diff options
author | Miao Xie <miaox@cn.fujitsu.com> | 2014-01-14 07:31:52 -0500 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2014-01-28 16:20:37 -0500 |
commit | 23c671a58831a5aaca3b56b915c8394a274a96df (patch) | |
tree | b8ae22e5b2e0566754f5343c1f15fd048c9eb3de /fs/btrfs | |
parent | 2c21b4d733d6e50514e30ffd87110364ddda695b (diff) |
Btrfs: flush the dirty pages of the ordered extent aggressively during logging csum
The performance of fsync dropped down suddenly sometimes, the main reason
of this problem was that we might only flush part dirty pages in a ordered
extent, then got that ordered extent, wait for the csum calcucation. But if
no task flushed the left part, we would wait until the flusher flushed them,
sometimes we need wait for several seconds, it made the performance drop
down suddenly. (On my box, it drop down from 56MB/s to 4-10MB/s)
This patch improves the above problem by flushing left dirty pages aggressively.
Test Environment:
CPU: 2CPU * 2Cores
Memory: 4GB
Partition: 20GB(HDD)
Test Command:
# sysbench --num-threads=8 --test=fileio --file-num=1 \
> --file-total-size=8G --file-block-size=32768 \
> --file-io-mode=sync --file-fsync-freq=100 \
> --file-fsync-end=no --max-requests=10000 \
> --file-test-mode=rndwr run
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/tree-log.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index b561e7a4007d..b142b6dc96c3 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c | |||
@@ -3637,7 +3637,11 @@ again: | |||
3637 | * start over after this. | 3637 | * start over after this. |
3638 | */ | 3638 | */ |
3639 | 3639 | ||
3640 | wait_event(ordered->wait, ordered->csum_bytes_left == 0); | 3640 | if (ordered->csum_bytes_left) { |
3641 | btrfs_start_ordered_extent(inode, ordered, 0); | ||
3642 | wait_event(ordered->wait, | ||
3643 | ordered->csum_bytes_left == 0); | ||
3644 | } | ||
3641 | 3645 | ||
3642 | list_for_each_entry(sum, &ordered->list, list) { | 3646 | list_for_each_entry(sum, &ordered->list, list) { |
3643 | ret = btrfs_csum_file_blocks(trans, log, sum); | 3647 | ret = btrfs_csum_file_blocks(trans, log, sum); |