qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Michael Roth <mdroth@linux.vnet.ibm.com>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org,
	duanj@linux.vnet.ibm.com, bharata@linux.vnet.ibm.com,
	dgilbert@redhat.com, quintela@redhat.com, amit.shah@redhat.com
Subject: Re: [Qemu-devel] [PATCH for-2.8 0/3] spapr: fix breakage of memory unplug after migration
Date: Fri, 18 Nov 2016 10:39:49 -0600	[thread overview]
Message-ID: <20161118163949.3756.44682@loki> (raw)
In-Reply-To: <20161118054505.GD31640@umbus.fritz.box>

Quoting David Gibson (2016-11-17 23:45:05)
> On Thu, Nov 17, 2016 at 07:40:24PM -0600, Michael Roth wrote:
> > These patches are based on David's ppc-for-2.8 tree, and are also
> > available from:
> > 
> >   https://github.com/mdroth/qemu/commits/spapr-cas-migration
> > 
> > Currently, memory hotplugged to a pseries guest cannot be removed after
> > the guest has been migrated. This is due to 2 issues:
> > 
> > 1) The coldplugged state of memory on the target side is one where the
> >    corresponding DRC's allocation state is:
> > 
> >      allocation_state == unallocated,
> >      awaiting_allocation == true,
> > 
> >    When the guest attempts to unplug memory on the target side, it first
> >    checks that allocation_state == allocated. If we fix this, the guest
> >    can successfully notify QEMU of completion on it's end, but then the
> >    DRC code sees that awaiting_allocation == true, so it defers the
> >    finalizing of the LMB and corresponding DIMM since it assumes that
> >    the DIMM must have been previously allocated before it can be removed.
> > 
> >    To address this, we pull in patches 1-2 from Jian Jun's DRC migration
> >    series:
> > 
> >      https://lists.gnu.org/archive/html/qemu-ppc/2016-10/msg00048.html
> > 
> >    with some minor changes relating to prior review comments, and
> >    the addition of migrating the DRC's awaiting_allocation value, which
> >    wasn't part of the original patch. This doesn't address the full scope
> >    of the issues Jian Jun was looking at (involving synchronizing state
> >    when migration occurs during fairly small race windows), just this
> >    particular case, which is more user visible since the time window is
> >    indefinite.
> > 
> > 2) The ability to unplug memory is gated on the QEMU side by a check as
> >    to whether or not support for newer-style hotplug events was negotiated
> >    via CAS during boot. The check is performed by checking the corresponding
> >    entry in the sPAPROptionVector structure. However, since this value isn't
> >    migrated currently, we are unable to unplug until after the guest reboots.
> > 
> >    We address that here by adding migration support for sPAPROptionVectors,
> >    and including the CAS-negotiated vector as part of the migration stream
> >    for any cases where we advertise newer-style hotplug event support to
> >    the guest.
> > 
> > David,
> > 
> > These fixes ended up going out much later than planned. I'm not sure
> > if you're planning another pull for 2.8 or not, and realize there are
> > some patches here not specifically pseries-related so it's
> > understandable if we opt to pursue these for 2.9/2.8.1 instead. But if
> > possible I'm hoping to get these in so that the memory unplug
> > support is fully functional for 2.8.
> 
> Yeah, I'm still expecting to push a few bugfixes in before 2.8.  So,
> I've merged these patches into ppc-for-2.8 (fixing a couple of trivial
> style nits along the way).  I have a couple of comments that I'll make
> on the patches, but they're not important enough to stop these going
> in ASAP.
> 
> Unfortunately, of course, this is not the only migration breakage we
> have at the moment.  I'm presently wrestling with both breakage due to
> changes in the insns_flags masks, and due to the reworking of the mmio
> windows for the PHB.

Ok, thanks for the heads up. FYI I'm still hoping to get the insns_flags
fix in for 2.7.1 (which is a bit behind at this point, should have schedule
and initial tree posted next week though), so I will keep an eye out for
those.

> 
> > 
> > 
> >  hw/core/qdev.c              |  6 +++++-
> >  hw/ppc/spapr.c              | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >  hw/ppc/spapr_drc.c          | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >  hw/ppc/spapr_ovec.c         | 12 ++++++++++++
> >  hw/ppc/spapr_pci.c          | 22 ++++++++++++++++++++++
> >  include/hw/ppc/spapr_drc.h  |  9 +++++++++
> >  include/hw/ppc/spapr_ovec.h |  4 ++++
> >  include/hw/qdev-core.h      |  9 +++++++++
> >  migration/savevm.c          |  4 ++--
> >  9 files changed, 201 insertions(+), 3 deletions(-)
> > 
> 
> -- 
> David Gibson                    | I'll have my music baroque, and my code
> david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
>                                 | _way_ _around_!
> http://www.ozlabs.org/~dgibson

  reply	other threads:[~2016-11-18 16:44 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-18  1:40 [Qemu-devel] [PATCH for-2.8 0/3] spapr: fix breakage of memory unplug after migration Michael Roth
2016-11-18  1:40 ` [Qemu-devel] [PATCH for-2.8 1/3] migration: alternative way to set instance_id in SaveStateEntry Michael Roth
2016-11-22  6:15   ` David Gibson
2016-11-22 10:23     ` Dr. David Alan Gilbert
2016-11-22 22:58     ` Michael Roth
2016-11-30 22:22       ` Michael Roth
2016-11-18  1:40 ` [Qemu-devel] [PATCH for-2.8 2/3] migration: spapr_drc: defined VMStateDescription struct Michael Roth
2016-11-18  6:04   ` David Gibson
2016-11-18 16:32     ` Michael Roth
2016-11-22 16:35   ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2016-11-22 17:24     ` Michael Roth
2016-11-22 17:33       ` Michael Roth
2016-11-22 21:28         ` Greg Kurz
2016-11-22 20:09       ` Greg Kurz
2016-11-18  1:40 ` [Qemu-devel] [PATCH for-2.8 3/3] spapr: migration support for CAS-negotiated option vectors Michael Roth
2016-11-18 16:08   ` Michael Roth
2016-11-20 23:57     ` David Gibson
2016-11-18  1:51 ` [Qemu-devel] [PATCH for-2.8 0/3] spapr: fix breakage of memory unplug after migration no-reply
2016-11-18  5:45 ` David Gibson
2016-11-18 16:39   ` Michael Roth [this message]
2016-11-20 23:58     ` David Gibson

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=20161118163949.3756.44682@loki \
    --to=mdroth@linux.vnet.ibm.com \
    --cc=amit.shah@redhat.com \
    --cc=bharata@linux.vnet.ibm.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=dgilbert@redhat.com \
    --cc=duanj@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@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).