From: Jan Kiszka <jan.kiszka@web.de>
To: lirans@il.ibm.com
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH 2/3 v5] Block live migration
Date: Tue, 24 Nov 2009 23:55:57 +0100 [thread overview]
Message-ID: <4B0C647D.6090709@web.de> (raw)
In-Reply-To: <1257169258297-git-send-email-lirans@il.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 1473 bytes --]
Hi Liran,
trying to understand the code and fixing some cosmetic issues around
progress reporting, one potentially performance-relevant question popped up:
lirans@il.ibm.com wrote:
> diff --git a/block-migration.c b/block-migration.c
> new file mode 100644
> index 0000000..4b4eddf
> --- /dev/null
> +++ b/block-migration.c
...
> +static int mig_read_device_bulk(QEMUFile *f, BlkMigDevState *bms)
> +{
> + int nr_sectors;
> + int64_t total_sectors, cur_sector = 0;
> + BlockDriverState *bs = bms->bs;
> + BlkMigBlock *blk;
> +
> + blk = qemu_malloc(sizeof(BlkMigBlock));
> + blk->buf = qemu_malloc(BLOCK_SIZE);
> +
> + cur_sector = bms->cur_sector;
> + total_sectors = bdrv_getlength(bs) >> SECTOR_BITS;
Why re-calculating total_sectors here? Specifically bdrv_getlength() can
be a non-trivial I/O operation.
And what is the difference to bms->total_sectors which looks a lot like...
[...]
> +
> +static void init_blk_migration(QEMUFile *f)
> +{
> + BlkMigDevState **pbmds, *bmds;
> + BlockDriverState *bs;
> +
> + for (bs = bdrv_first; bs != NULL; bs = bs->next) {
> + if(bs->type == BDRV_TYPE_HD) {
> + bmds = qemu_mallocz(sizeof(BlkMigDevState));
> + bmds->bs = bs;
> + bmds->bulk_completed = 0;
> + bmds->total_sectors = bdrv_getlength(bs) >> SECTOR_BITS;
...it already contains all the information we need?
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]
next prev parent reply other threads:[~2009-11-24 22:56 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-02 13:40 [Qemu-devel] [PATCH 2/3 v5] Block live migration lirans
2009-11-24 22:55 ` Jan Kiszka [this message]
2009-11-26 7:13 ` [Qemu-devel] " Liran Schour
2009-11-26 7:39 ` Jan Kiszka
2009-11-26 13:53 ` Jan Kiszka
2009-11-26 15:50 ` Liran Schour
2009-11-26 17:05 ` Jan Kiszka
2009-11-26 17:24 ` Jan Kiszka
2009-11-30 11:49 ` Liran Schour
2009-11-30 12:01 ` Jan Kiszka
2009-11-26 18:06 ` Pierre Riteau
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=4B0C647D.6090709@web.de \
--to=jan.kiszka@web.de \
--cc=lirans@il.ibm.com \
--cc=qemu-devel@nongnu.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.