diff options
author | Lukas Czerner <lczerner@redhat.com> | 2011-05-07 03:26:27 +0200 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2011-05-07 03:26:27 +0200 |
commit | 5dba3089ed03f84b84c6c739df8330112f04a15d (patch) | |
tree | a61a12a0a13eba03b47fe1cba76afe5ac8677992 /include | |
parent | SATA: enable non-queueable flush flag (diff) | |
download | linux-5dba3089ed03f84b84c6c739df8330112f04a15d.tar.xz linux-5dba3089ed03f84b84c6c739df8330112f04a15d.zip |
blkdev: Submit discard bio in batches in blkdev_issue_discard()
Currently we are waiting for every submitted REQ_DISCARD bio separately,
but it can have unwanted consequences of repeatedly flushing the queue,
so we rather submit bios in batches and wait for the entire batch, hence
narrowing the window of other ios going in.
Use bio_batch_end_io() and struct bio_batch for that purpose, the same
is used by blkdev_issue_zeroout(). Also change bio_batch_end_io() so we
always set !BIO_UPTODATE in the case of error and remove the check for
bb, since we are the only user of this function and we always set this.
Remove bio_get()/bio_put() from the blkdev_issue_discard() since
bio_alloc() and bio_batch_end_io() is doing the same thing, hence it is
not needed anymore.
I have done simple dd testing with surprising results. The script I have
used is:
for i in $(seq 10); do
echo $i
dd if=/dev/sdb1 of=/dev/sdc1 bs=4k &
sleep 5
done
/usr/bin/time -f %e ./blkdiscard /dev/sdc1
Running time of BLKDISCARD on the whole device:
with patch without patch
0.95 15.58
So we can see that in this artificial test the kernel with the patch
applied is approx 16x faster in discarding the device.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
CC: Dmitry Monakhov <dmonakhov@openvz.org>
CC: Jens Axboe <jaxboe@fusionio.com>
CC: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions