]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commit
block/iscsi: speed up read for unallocated sectors
authorPeter Lieven <pl@kamp.de>
Mon, 28 Apr 2014 11:11:32 +0000 (13:11 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 29 Apr 2014 09:14:25 +0000 (11:14 +0200)
commitb03c38057b7ac4ffb60fa98a26dd4c8d5fa9c54c
tree797d5148c4e75e1dab5063a5ed1ea0c05a47480b
parentdbe5c58f2a44f49572b3346400779fac818fcaea
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>
block/iscsi.c