diff options
author | Peter Lieven <pl@kamp.de> | 2014-04-28 13:11:32 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-04-29 11:14:25 +0200 |
commit | b03c38057b7ac4ffb60fa98a26dd4c8d5fa9c54c (patch) | |
tree | 797d5148c4e75e1dab5063a5ed1ea0c05a47480b /blockdev.c | |
parent | dbe5c58f2a44f49572b3346400779fac818fcaea (diff) | |
download | hqemu-b03c38057b7ac4ffb60fa98a26dd4c8d5fa9c54c.zip hqemu-b03c38057b7ac4ffb60fa98a26dd4c8d5fa9c54c.tar.gz |
block/iscsi: speed up read for unallocated sectors
this patch implements a cache that tracks if a page on the
iscsi target is allocated or not. The cache is implemented in
a way that it allows for false positives
(e.g. pretending a page is allocated, but it isn't), but
no false negatives.
The cached allocation info is then used to speed up the
read process for unallocated sectors by issueing a GET_LBA_STATUS
request for all sectors that are not yet known to be allocated.
If the read request is confirmed to fall into an unallocated
range we directly return zeroes and do not transfer the
data over the wire.
Tests have shown that a relatively small amount of GET_LBA_STATUS
requests happens a vServer boot time to fill the allocation cache
(all those blocks are not queried again).
Not to transfer all the data of unallocated sectors saves a lot
of time, bandwidth and storage I/O load during block jobs or storage
migration and it saves a lot of bandwidth as well for any big sequential
read of the whole disk (e.g. block copy or speed tests) if a significant
number of blocks is unallocated.
Signed-off-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'blockdev.c')
0 files changed, 0 insertions, 0 deletions