On 10/11/2015 11:12, Kevin Wolf wrote: > > For full mirroring, this strategy will probably make the first > > incremental iteration more expensive. > > You mean because we issue smaller, interleaved write and write_zeroes > requests now instead of only large writes? That's probably right, but > getting the right result should be more important than speed. :-)
No, because you might end up clearing the whole dirty bitmap before issuing the first bdrv_get_block_status_above(). Blocks are actually read much later; if someone sets the dirty bitmap in between, you will re-write those blocks unnecessarily during the first incremental iteration. It's not specific to the first iteration, it's just more likely. However, it may be enough to clamp the number of dirty bitmap bits that you process in one go (e.g. to 100 MB of so). Paolo