qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Pavel Fedin <p.fedin@samsung.com>
Cc: peter.maydell@linaro.org, quintela@redhat.com,
	marc.zyngier@arm.com, 'QEMU' <qemu-devel@nongnu.org>,
	amit.shah@redhat.com, kvmarm@lists.cs.columbia.edu,
	christoffer.dall@linaro.org
Subject: Re: [Qemu-devel] Live migration sequence
Date: Tue, 13 Oct 2015 12:05:27 +0100	[thread overview]
Message-ID: <20151013110527.GB2555@work-vm> (raw)
In-Reply-To: <00b801d1059e$d6d4ffb0$847eff10$@samsung.com>

* Pavel Fedin (p.fedin@samsung.com) wrote:
>  Hello!
> 
>  Sorry for the delayed reply.

> > What's an ITS ?
> 
>  Interrupt Translation Service. In a short, it's a thing responsible for handling PCIe MSI-X
> interrupts on ARM64 architecture.

OK; I asked Peter (cc'd) to explain a bit more about the ITS to me.

> > With a related question, how big are the tables and can it change during the iterated part
> > of the migrate?
> 
>  Tables are something like 64K each. They hold mappings between device/event IDs and actual IRQ
> numbers.
>
>  Unfortunately i don't know how to answer the second part of the question, about iterated part. Can
> you explain in details, what is it and how does it work?

QEMU migrates stuff in two different ways:
   a) Like a device where at the end of the migration it transmits all the information
   b) Like RAM, (iterated) - in this it sends the contents across but does this while the guest
     is still running, changes that are made to the RAM are then transmitted over and over again
     until the amount of changed RAM is small; then we stop the guest, transmit those last few
     changes and then do (a).

>  Or, well, we could put the question the other way: imagine that in pre_save i tell my emulated
> device to flush its cached state into RAM-based tables. In post_load i could tell the device to
> re-read data from RAM into its cache. So, what do i need in order to make these tables in RAM to
> migrate correctly?

At 64k that's pretty small; however Peter explained to me that's per-cpu so that potentially
could be huge.  If it was only small I'd do it just like a device which is nice
and simple; but since it can get big then it's going to be more interesting, and
since it's part of guest RAM you need to be careful.

The pre_load/post_load are all relative to a particular device; they're
not hooked around when other stuff (RAM) gets migrated; it sounds like you
need another hook.

If I understand correctly what you need is to find a hook to dump the state
into guest ram, but then you also need to keep the state updated in guest
RAM during the migration.

Some thoughts:
  a) There is a migration state notifier list - see add_migration_state_change_notifier (spice calls it)
     - but I don't think it's called in the right places for your needs;  we
     could add some more places that gets called.

  b) Once you're in the device state saving (a above) you must not change guest RAM,
     because at that point the migration code won't send any new changes across
     to the destination. So any sync's you're going to do have to happen before/at
     the time we stop the CPU and do the final RAM sync.  On the plus side, when
     you're loading the device state in (a) you can be sure the RAM contents are there.

  c) Watch out for the size of that final sync; if you have lots of these ITS
     and they all update their 64k page at the point we stop the CPU then you're
     going to generate a lot of RAM that needs syncing.

Dave

> 
> Kind regards,
> Pavel Fedin
> Expert Engineer
> Samsung Electronics Research center Russia
> 
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

  reply	other threads:[~2015-10-13 11:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-08 11:39 [Qemu-devel] Live migration sequence Pavel Fedin
2015-10-09 15:29 ` Dr. David Alan Gilbert
2015-10-13 10:06   ` Pavel Fedin
2015-10-13 11:05     ` Dr. David Alan Gilbert [this message]
2015-10-13 12:02       ` Pavel Fedin
2015-10-13 12:04         ` Peter Maydell
2015-10-13 12:41           ` Pavel Fedin
2015-10-16  7:24       ` Pavel Fedin
2015-10-16 17:11         ` Dr. David Alan Gilbert

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=20151013110527.GB2555@work-vm \
    --to=dgilbert@redhat.com \
    --cc=amit.shah@redhat.com \
    --cc=christoffer.dall@linaro.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=marc.zyngier@arm.com \
    --cc=p.fedin@samsung.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.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).