v1: - Drop the RFC tag.
- Update to use bio_segments accordingly as __bio_segments is removed.
- Remove if (!bio) since bio_clone_fast with bioset and GFP_NOFS will
never fail.
This attempts to use bio_clone_fast() in the places where we clone bio,
such as when bio got cloned for multiple disks and when bio got split
during dio submit.
One benefit is to simplify dio submit to avoid calling bio_add_page one by
one.
Another benefit is that comparing to bio_clone_bioset, bio_clone_fast is
faster because of copying the vector pointer directly, and bio_clone_fast
doesn't modify bi_vcnt, so the extra work is to fix up bi_vcnt usage we
currently have to use bi_iter to iterate bvec.
Here are some numbers collected with the script [1], note that most of
performance tests usually issue bs=4k dio write/read so our directIO split code
is not tested as it requires bs > stripe_len(64K), thus I made this simple
script which writes 2G with bs=128K.
- vanilla:
real 0m10.265s
user 0m0.005s
sys 0m9.164s
- patched:
real 0m8.973s
user 0m0.006s
sys 0m7.804s
[1]:
#!/bin/bash
M=/mnt/btrfs
D1=/dev/pmem0p1
D2=/dev/pmem0p2
umount $M
mkfs.btrfs -f $D1 $D2 >/dev/null || exit
mount $D1 $M -onodatasum || exit
xfs_io -f -c "falloc 0 2G" $M/foo
time xfs_io -d -c "pwrite -b 128K 0 2G" $M/foo
Liu Bo (8):
Btrfs: use bio_clone_fast to clone our bio
Btrfs: new helper btrfs_bio_clone_partial
Btrfs: use bio_clone_bioset_partial to simplify DIO submit
Btrfs: change how we iterate bios in endio
Btrfs: record error if one block has failed to retry
Btrfs: make check-integrity use bvec_iter
Btrfs: unify naming of btrfs_io_bio
Btrfs: hardcode GFP_NOFS for btrfs_bio_clone_partial
fs/btrfs/check-integrity.c | 27 +++---
fs/btrfs/extent_io.c | 20 ++++-
fs/btrfs/extent_io.h | 1 +
fs/btrfs/file-item.c | 31 ++++---
fs/btrfs/inode.c | 204 ++++++++++++++++++++-------------------------
fs/btrfs/volumes.h | 1 +
6 files changed, 142 insertions(+), 142 deletions(-)
--
2.9.4
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html