Skip to contentSkip to conversation

introduce bitmap to bdrv_commit to track dirty sector

RFC Zhang Haoyu 3 participants 11 messages Mar 3, 2015 – Mar 10, 2015

lore
Share & tools
lore
#0 lore raw

Hi,
If introducing bitmap to bdrv_commit to track dirty sector, could we implement guest non-disruption while performing commit?

Thanks,
Zhang Haoyu

#1 lore raw
Quoted 3 lines · Zhang Haoyu

Hi,
If introducing bitmap to bdrv_commit to track dirty sector, could we implement guest non-disruption while performing commit?

That is already implemented. It uses the same code that implements storage migration (block/mirror.c).

Paolo

#2 lore raw
Quoted 9 lines · Paolo Bonzini
Quoted 3 lines · Zhang Haoyu

Hi,
If introducing bitmap to bdrv_commit to track dirty sector, could we implement guest non-disruption while performing commit?

That is already implemented. It uses the same code that implements storage migration (block/mirror.c).

Hi Paolo,
do you mean commit_active_start()?

Quoted 1 line

Paolo

#3 lore raw
Quoted 8 lines · Zhang Haoyu
Quoted 6 lines · Paolo Bonzini
Quoted 3 lines · Zhang Haoyu

Hi,
If introducing bitmap to bdrv_commit to track dirty sector, could we implement guest non-disruption while performing commit?

Quoted 5 lines
Quoted 3 lines

That is already implemented. It uses the same code that implements storage migration (block/mirror.c).

Hi Paolo,
do you mean commit_active_start()?

Yes.

Paolo

#4 lore raw
In reply to Zhang Haoyu

Hi John, Vladimir
We can using active block commit to implement incremental backup without guest disruption, e.g.,
origin <= A <= B <= C <= current BDS,
a new external snapshot will be produced before every time backup,
we can migrate A, B, C, ... to destination,
then commit_active_start() the unneeded snapshot in source or destination end.

So, comparing with above mechanism,
what's the advantages of the incremental backup implemented by John and Vladimir?

Thanks,
Zhang Haoyu

Quoted 19 lines · Paolo Bonzini
Quoted 8 lines · Zhang Haoyu
Quoted 6 lines · Paolo Bonzini
Quoted 3 lines · Zhang Haoyu

Hi,
If introducing bitmap to bdrv_commit to track dirty sector, could we implement guest non-disruption while performing commit?

Quoted 5 lines
Quoted 3 lines

That is already implemented. It uses the same code that implements storage migration (block/mirror.c).

Hi Paolo,
do you mean commit_active_start()?

Yes.

Paolo

#5 lore raw
Quoted 10 lines · Zhang Haoyu

Hi John, Vladimir
We can using active block commit to implement incremental backup without guest disruption, e.g.,
origin <= A <= B <= C <= current BDS,
a new external snapshot will be produced before every time backup,
we can migrate A, B, C, ... to destination,
then commit_active_start() the unneeded snapshot in source or destination end.

So, comparing with above mechanism,
what's the advantages of the incremental backup implemented by John and Vladimir?

We can't migrate A, B, C because they are buried in the backing chain under "current BDS". Even if we do that, there will be severe IO amplification compared to the dirty bitmap way.

For the same reason we have drive-backup (write intercept) instead of a "snapshot + drive-mirror" analogue.

Fam

#6 lore raw

Re: [Qemu-devel] [RFC] introduce bitmap to bdrv_commit to trackdirty sector

In reply to Zhang Haoyu
Quoted 9 lines · Fam Zheng
Quoted 8 lines · Zhang Haoyu

Hi John, Vladimir
We can using active block commit to implement incremental backup without guest disruption, e.g.,
origin <= A <= B <= C <= current BDS,
a new external snapshot will be produced before every time backup,
we can migrate A, B, C, ... to destination,
then commit_active_start() the unneeded snapshot in source or destination end.

Quoted 5 lines
Quoted 2 lines

So, comparing with above mechanism,
what's the advantages of the incremental backup implemented by John and Vladimir?

We can't migrate A, B, C because they are buried in the backing chain under "current BDS".

I think we can backup the incremental image(e.g., A, B, C) to destination in top mode, although I haven't read the code in detail, it can work theoretically, I think.

Quoted 3 lines

Even if we do that, there will be severe IO amplification compared to the dirty bitmap way.

Yes, block-commit will produce extra IO.
But regarding incremental backup, when guest IO is performed,
will the corresponding dirty bit be synchronized to qcow2 image simultaneously?
If yes, it will impact on IO throughput in two sides, I think,
1) extro IO 2) randomize the IO,
if no, if source VM is shut-down in non-normal way, like killed by force or by mistake or server poweroff suddenly, some dirty bits maybe lost, then full copy is needed.

Quoted 3 lines

For the same reason we have drive-backup (write intercept) instead of a "snapshot + drive-mirror" analogue.

drive-backup is not incremental backup, full copy is needed in every time backup, so it dosen't meet our requirements.

Zhang Haoyu

Quoted 1 line

Fam

#7 lore raw

Re: [Qemu-devel] [RFC] introduce bitmap to bdrv_commit to trackdirty sector

Quoted 11 lines · Zhang Haoyu
Quoted 9 lines · Fam Zheng
Quoted 8 lines · Zhang Haoyu

Hi John, Vladimir
We can using active block commit to implement incremental backup without guest disruption, e.g.,
origin <= A <= B <= C <= current BDS,
a new external snapshot will be produced before every time backup,
we can migrate A, B, C, ... to destination,
then commit_active_start() the unneeded snapshot in source or destination end.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

So, comparing with above mechanism,
what's the advantages of the incremental backup implemented by John and Vladimir?

We can't migrate A, B, C because they are buried in the backing chain under "current BDS".

I think we can backup the incremental image(e.g., A, B, C) to destination in top mode, although I haven't read the code in detail, it can work theoretically, I think.

No, we don't have any command do that.

Quoted 7 lines
Quoted 4 lines

Even if we do that, there will be severe IO amplification compared to the dirty bitmap way.

Yes, block-commit will produce extra IO.
But regarding incremental backup, when guest IO is performed,
will the corresponding dirty bit be synchronized to qcow2 image simultaneously?

No, that would have a huge performance penalty. It will only be synced at shutdown and or periodically, therefore it has the same implications with other cache, such as page cache or block driver metadata cache.

Quoted 2 lines

if no, if source VM is shut-down in non-normal way, like killed by force or by mistake or server poweroff suddenly, some dirty bits maybe lost, then full copy is needed.

Yes, it is a reasonable rule.

Quoted 3 lines
Quoted 1 line

drive-backup is not incremental backup, full copy is needed in every time backup, so it dosen't meet our requirements.

I didn't mean drive-backup already provides incremental backup, but we do need it to implement it (see the patch series posted by John Snow).

Thanks,
Fam

#8 lore raw

Re: [Qemu-devel] [RFC] introduce bitmap to bdrv_commit to trackdirtysector

In reply to Zhang Haoyu
Quoted 15 lines · Fam Zheng
Quoted 14 lines · Zhang Haoyu
Quoted 12 lines · Fam Zheng
Quoted 10 lines · Zhang Haoyu

Hi John, Vladimir
We can using active block commit to implement incremental backup without guest disruption, e.g.,
origin <= A <= B <= C <= current BDS,
a new external snapshot will be produced before every time backup,
we can migrate A, B, C, ... to destination,
then commit_active_start() the unneeded snapshot in source or destination end.

So, comparing with above mechanism,
what's the advantages of the incremental backup implemented by John and Vladimir?

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

We can't migrate A, B, C because they are buried in the backing chain under "current BDS".

I think we can backup the incremental image(e.g., A, B, C) to destination in top mode, although I haven't read the code in detail, it can work theoretically, I think.

No, we don't have any command do that.

Is it worthy to implement it?
And does qemu support commit any external snapshot to its backing file?

Quoted 26 lines
Quoted 7 lines
Quoted 4 lines

Even if we do that, there will be severe IO amplification compared to the dirty bitmap way.

Yes, block-commit will produce extra IO.
But regarding incremental backup, when guest IO is performed,
will the corresponding dirty bit be synchronized to qcow2 image simultaneously?

No, that would have a huge performance penalty. It will only be synced at shutdown and or periodically, therefore it has the same implications with other cache, such as page cache or block driver metadata cache.

Quoted 2 lines

if no, if source VM is shut-down in non-normal way, like killed by force or by mistake or server poweroff suddenly, some dirty bits maybe lost, then full copy is needed.

Yes, it is a reasonable rule.

Quoted 3 lines
Quoted 1 line

drive-backup is not incremental backup, full copy is needed in every time backup, so it dosen't meet our requirements.

I didn't mean drive-backup already provides incremental backup, but we do need it to implement it (see the patch series posted by John Snow).

Thanks,
Fam

#9 lore raw

Re: [Qemu-devel] [RFC] introduce bitmap to bdrv_commit to trackdirtysector

Quoted 1 line

Is it worthy to implement it?

Maybe, I think once we start to assign node-name to each BDS in the tree, this will be natural to implement.

Quoted 1 line

And does qemu support commit any external snapshot to its backing file?

Yes.

#10 lore raw

Re: [Qemu-devel] [RFC] introduce bitmap to bdrv_commit totrackdirtysector

In reply to Zhang Haoyu
Quoted 5 lines · Fam Zheng
Quoted 1 line

Is it worthy to implement it?

Maybe, I think once we start to assign node-name to each BDS in the tree, this will be natural to implement.

Once implemented, to be honest, I really don't see much advantages of
incremental backup over aforementioned mechanism(external snapshot + active block commit), especially, regarding the case of source vm non-normal shutdown, full copy is needed, and corresponding check mechanism is needed too.
I think so much exceptional scenarios are needed to be considered for incremental backup mechanism. Maybe I missed something.

Thanks,
Zhang Haoyu

Quoted 3 lines
Quoted 1 line

And does qemu support commit any external snapshot to its backing file?

Yes.