From: Stefan Hajnoczi <stefanha@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Cc: Fam Zheng <famz@redhat.com>,
qemu-block@nongnu.org, qemu-devel@nongnu.org, kwolf@redhat.com,
jcody@redhat.com, mreitz@redhat.com, pbonzini@redhat.com,
den@openvz.org, jsnow@redhat.com
Subject: Re: [Qemu-devel] [PATCH 03/21] backup: improve non-dirty bits progress processing
Date: Tue, 31 Jan 2017 10:56:46 +0000 [thread overview]
Message-ID: <20170131105646.GD18804@stefanha-x1.localdomain> (raw)
In-Reply-To: <c7ab4cec-2d0d-8a49-7fc3-fe617d5f61fd@virtuozzo.com>
[-- Attachment #1: Type: text/plain, Size: 4678 bytes --]
On Tue, Jan 24, 2017 at 12:12:47PM +0300, Vladimir Sementsov-Ogievskiy wrote:
> 24.01.2017 10:17, Fam Zheng wrote:
> > On Fri, 12/23 17:28, Vladimir Sementsov-Ogievskiy wrote:
> > > Set fake progress for non-dirty clusters in copy_bitmap initialization,
> > > to:
> > > 1. set progress in the same place where corresponding clusters are
> > > consumed from copy_bitmap (or not initialized, as here)
> > > 2. earlier progress information for user
> > > 3. simplify the code
> > >
> > > Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> > > ---
> > > block/backup.c | 18 +++---------------
> > > 1 file changed, 3 insertions(+), 15 deletions(-)
> > >
> > > diff --git a/block/backup.c b/block/backup.c
> > > index 621b1c0..f1f87f6 100644
> > > --- a/block/backup.c
> > > +++ b/block/backup.c
> > > @@ -383,7 +383,6 @@ static int coroutine_fn backup_run_incremental(BackupBlockJob *job)
> > > int64_t sector;
> > > int64_t cluster;
> > > int64_t end;
> > > - int64_t last_cluster = -1;
> > > int64_t sectors_per_cluster = cluster_size_sectors(job);
> > > BdrvDirtyBitmapIter *dbi;
> > > @@ -395,12 +394,6 @@ static int coroutine_fn backup_run_incremental(BackupBlockJob *job)
> > > while ((sector = bdrv_dirty_iter_next(dbi)) != -1) {
> > > cluster = sector / sectors_per_cluster;
> > > - /* Fake progress updates for any clusters we skipped */
> > > - if (cluster != last_cluster + 1) {
> > > - job->common.offset += ((cluster - last_cluster - 1) *
> > > - job->cluster_size);
> > > - }
> > > -
> > > for (end = cluster + clusters_per_iter; cluster < end; cluster++) {
> > > do {
> > > if (yield_and_check(job)) {
> > > @@ -422,14 +415,6 @@ static int coroutine_fn backup_run_incremental(BackupBlockJob *job)
> > > if (granularity < job->cluster_size) {
> > > bdrv_set_dirty_iter(dbi, cluster * sectors_per_cluster);
> > > }
> > > -
> > > - last_cluster = cluster - 1;
> > > - }
> > > -
> > > - /* Play some final catchup with the progress meter */
> > > - end = DIV_ROUND_UP(job->common.len, job->cluster_size);
> > > - if (last_cluster + 1 < end) {
> > > - job->common.offset += ((end - last_cluster - 1) * job->cluster_size);
> > > }
> > > out:
> > > @@ -462,6 +447,9 @@ static void backup_incremental_init_copy_bitmap(BackupBlockJob *job)
> > > bdrv_set_dirty_iter(dbi, (cluster + cl_gran) * sectors_per_cluster);
> > > }
> > > + job->common.offset = job->common.len -
> > > + hbitmap_count(job->copy_bitmap) * job->cluster_size;
> > > +
> > > bdrv_dirty_iter_free(dbi);
> > > }
> > Is this effectively moving the progress reporting from cluster copying to dirty
> > bitmap initialization? If so the progress will stay "100%" once
> > backup_incremental_init_copy_bitmap returns, but the backup has merely started.
> > I don't think this is a good idea.
> >
> > Fam
>
> Currently progress tracking for incremental backup is bad too. Holes are bad
> for progress in any way. To make good progress we should calculate it like
> (cluters _physically_ copied) / (full amount of clusters to be _physically_
> copied). And with current qapi scheme it is not possible. This formula may
> be approximated by (offset - skipped_clusters) / (len - skipped_clusters),
> where offset and len are old good len, and skipped_clusters should be added
> to query_block_jobs. And with such approximation it is obvious that it will
> be more presize if we skip all clusters that should be skipped earlier. The
> best way of course is to skip them in initialization. It is not possible (if
> I understand things right) for full mode, as it skips clusters using
> get_block_status which may be long operation, so we should start notifier
> handling before skipping operation is finished...
>
> Any way, it is work of management tool to show beautiful progress, qemu only
> provides information for it, and with current scheme, the only way to
> provide information about cluster skipping in copying progress is by offset
> field. And it is not bad to provide this information earlier. And again, to
> produce really beautiful progress we at least need one more field -
> skipped_clusters.
If you want to change the semantics of the progress indicator, please
send it as a separate series.
I'm not convinced by this patch but it shouldn't block the rest of
the series from being merged.
Stefan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
next prev parent reply other threads:[~2017-01-31 12:45 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-23 14:28 [Qemu-devel] [PATCH 00/21] new backup architecture Vladimir Sementsov-Ogievskiy
2016-12-23 14:28 ` [Qemu-devel] [PATCH 01/21] backup: move from done_bitmap to copy_bitmap Vladimir Sementsov-Ogievskiy
2017-01-23 5:34 ` Jeff Cody
2017-01-23 12:20 ` Vladimir Sementsov-Ogievskiy
2017-01-31 10:25 ` Stefan Hajnoczi
2016-12-23 14:28 ` [Qemu-devel] [PATCH 02/21] backup: init copy_bitmap from sync_bitmap for incremental Vladimir Sementsov-Ogievskiy
2017-01-24 7:09 ` Fam Zheng
2017-01-24 9:00 ` Vladimir Sementsov-Ogievskiy
2017-01-24 9:46 ` Fam Zheng
2017-01-24 10:16 ` Vladimir Sementsov-Ogievskiy
2017-01-31 10:36 ` Stefan Hajnoczi
2016-12-23 14:28 ` [Qemu-devel] [PATCH 03/21] backup: improve non-dirty bits progress processing Vladimir Sementsov-Ogievskiy
2017-01-24 7:17 ` Fam Zheng
2017-01-24 9:12 ` Vladimir Sementsov-Ogievskiy
2017-01-31 10:56 ` Stefan Hajnoczi [this message]
2016-12-23 14:28 ` [Qemu-devel] [PATCH 04/21] backup: use copy_bitmap in incremental backup Vladimir Sementsov-Ogievskiy
2017-01-31 11:01 ` Stefan Hajnoczi
2016-12-23 14:28 ` [Qemu-devel] [PATCH 05/21] hbitmap: improve dirty iter Vladimir Sementsov-Ogievskiy
2017-01-31 11:20 ` Stefan Hajnoczi
2017-01-31 11:29 ` Stefan Hajnoczi
2016-12-23 14:28 ` [Qemu-devel] [PATCH 06/21] backup: rewrite top mode cluster skipping Vladimir Sementsov-Ogievskiy
2017-01-31 13:31 ` Stefan Hajnoczi
2016-12-23 14:28 ` [Qemu-devel] [PATCH 07/21] backup: refactor: merge top/full/incremental backup code Vladimir Sementsov-Ogievskiy
2017-01-31 14:26 ` Stefan Hajnoczi
2016-12-23 14:28 ` [Qemu-devel] [PATCH 08/21] backup: skip unallocated clusters for full mode Vladimir Sementsov-Ogievskiy
2017-01-24 7:59 ` Fam Zheng
2017-01-24 9:18 ` Vladimir Sementsov-Ogievskiy
2017-01-24 9:36 ` Fam Zheng
2017-01-24 10:13 ` Vladimir Sementsov-Ogievskiy
2017-01-24 11:12 ` Fam Zheng
2017-01-31 14:33 ` Stefan Hajnoczi
2017-01-31 14:38 ` Stefan Hajnoczi
2016-12-23 14:28 ` [Qemu-devel] [PATCH 09/21] backup: separate copy function Vladimir Sementsov-Ogievskiy
2017-01-31 14:40 ` Stefan Hajnoczi
2016-12-23 14:28 ` [Qemu-devel] [PATCH 10/21] backup: refactor backup_copy_cluster() Vladimir Sementsov-Ogievskiy
2017-01-31 14:57 ` Stefan Hajnoczi
2016-12-23 14:28 ` [Qemu-devel] [PATCH 11/21] backup: move r/w error handling code to r/w functions Vladimir Sementsov-Ogievskiy
2017-01-31 14:57 ` Stefan Hajnoczi
2016-12-23 14:28 ` [Qemu-devel] [PATCH 12/21] iotests: add supported_cache_modes to main function Vladimir Sementsov-Ogievskiy
2017-01-31 14:58 ` Stefan Hajnoczi
2016-12-23 14:28 ` [Qemu-devel] [PATCH 13/21] coroutine: add qemu_coroutine_add_next Vladimir Sementsov-Ogievskiy
2017-01-31 15:03 ` Stefan Hajnoczi
2016-12-23 14:28 ` [Qemu-devel] [PATCH 14/21] block: add trace point on bdrv_close_all Vladimir Sementsov-Ogievskiy
2017-01-31 15:03 ` Stefan Hajnoczi
2016-12-23 14:28 ` [Qemu-devel] [PATCH 15/21] bitmap: add bitmap_count_between() function Vladimir Sementsov-Ogievskiy
2017-01-31 15:15 ` Stefan Hajnoczi
2016-12-23 14:28 ` [Qemu-devel] [PATCH 16/21] hbitmap: add hbitmap_count_between() function Vladimir Sementsov-Ogievskiy
2017-01-31 15:56 ` Stefan Hajnoczi
2016-12-23 14:29 ` [Qemu-devel] [PATCH 17/21] backup: make all reads not serializing Vladimir Sementsov-Ogievskiy
2017-01-31 16:30 ` Stefan Hajnoczi
2016-12-23 14:29 ` [Qemu-devel] [PATCH 18/21] backup: new async architecture Vladimir Sementsov-Ogievskiy
2017-01-31 16:46 ` Stefan Hajnoczi
2017-02-01 16:13 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2016-12-23 14:29 ` [Qemu-devel] [PATCH 20/21] backup: move bitmap handling from backup_do_cow to get_work Vladimir Sementsov-Ogievskiy
2016-12-23 14:29 ` [Qemu-devel] [PATCH 21/21] backup: refactor: remove backup_do_cow() Vladimir Sementsov-Ogievskiy
2017-01-09 11:04 ` [Qemu-devel] [PATCH 00/21] new backup architecture Stefan Hajnoczi
2017-01-10 6:05 ` Jeff Cody
2017-01-10 18:48 ` John Snow
2017-01-31 10:20 ` Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170131105646.GD18804@stefanha-x1.localdomain \
--to=stefanha@redhat.com \
--cc=den@openvz.org \
--cc=famz@redhat.com \
--cc=jcody@redhat.com \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).