From: Jan Kiszka <jan.kiszka@web.de>
To: Liran Schour <LIRANS@il.ibm.com>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH 2/3 v5] Block live migration
Date: Thu, 26 Nov 2009 08:39:17 +0100 [thread overview]
Message-ID: <4B0E30A5.9060200@web.de> (raw)
In-Reply-To: <OF0519CA4A.CC439E96-ONC225767A.00276356-C225767A.0027A6A2@il.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 1843 bytes --]
Liran Schour wrote:
> jan.kiszka@web.de wrote on 25/11/2009 00:55:57:
>
>
>> 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?
>>
>
> You are right no need to figure it out once again. We can use the old
> total_sectors value.
Perfect.
Meanwhile I've quite a few patches here, including that change, will
hopefully manage to send them out today.
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]
next prev parent reply other threads:[~2009-11-26 7:39 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 ` [Qemu-devel] " Jan Kiszka
2009-11-26 7:13 ` Liran Schour
2009-11-26 7:39 ` Jan Kiszka [this message]
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=4B0E30A5.9060200@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 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).