From: Tang Chen <tangchen@cn.fujitsu.com>
To: Igor Mammedov <imammedo@redhat.com>,
zhanghailiang <zhang.zhanghailiang@huawei.com>
Cc: zhugh.fnst@cn.fujitsu.com, mst@redhat.com, hutao@cn.fujitsu.com,
qemu-devel@nongnu.org, isimatu.yasuaki@jp.fujitsu.com,
pbonzini@redhat.com
Subject: Re: [Qemu-devel] [RESEND PATCH v3 5/8] pc-dimm: Add pc_dimm_unrealize() for memory hot unplug support.
Date: Wed, 24 Sep 2014 15:02:49 +0800 [thread overview]
Message-ID: <54226C99.90508@cn.fujitsu.com> (raw)
In-Reply-To: <20140912151757.17e128ed@nial.usersys.redhat.com>
Hi Igor, Zhang,
On 09/12/2014 09:17 PM, Igor Mammedov wrote:
> ......
> Actually, this patch also fix the bug *when hotplug memory failing in
> the place where after pc_dimm_plug but before the end of device_set_realized,
> it does not clear the work done by pc_dimm_plug*.
>
> For there is no callback like pc_dimm_plug_fail_cb for us to call when fail,
> Maybe pc_dimm_unrealize is the only place where we can do the clear work...
> Looking at device_set_realized() and pc-dimm case in patrticular
> there is no point where it could fail after hotplug_handler_plug() is called.
>
> But even if there where, one should use pc_dimm_unplug() first to
> reverse actions performed by successful pc_dimm_plug().
>
> The problem here is that currently unplug callback is actually
> doing only unplug request part asking guest to eject memory,
> but we also have destroy device when guest tells via ACPI to
> ejct memory. You are doing it implicitly by unparenting pc-dimm
> from ACPI code and pulling in pc-dimm.unrealize() unrelated
> stuff that should be done by PCMachine.
>
> I'm suggesting that we extend hotplug-handler API to handle
> this async/split unplug workflow. By converting current
> hotplug_handler_unplug() and related code to
> hotplug_handler_unplug_request() that would do the first part
> of unplug sequence (see/review http://patchwork.ozlabs.org/patch/387018/)
I've read the above patch.
1. I think you proposal would help to resolve the following problem:
If guest OS failed to handle hoplug sci, QEmu does not know it, and
could
release resources incorrectly.
Would you please have a look at the following patch.
https://www.mail-archive.com/qemu-devel%40nongnu.org/msg253025.html
I added a pthread wait condition to synchronize :
sci request -> guest OS handling -> _OST -> QEmu handling
(Of course, according to the previous discussing, _OST is optional.)
And IIUC, your proposal may be :
hotplug request -> guest OS handling -> real hotplug handling
right ?
I think it is the same. How do you think synchronize it with a wait
condition ?
Or you have any better idea ?
Since no one has replied the patch, I'm not sure if it is OK.
2. Let's finish memory and cpu hotplug job based on the current
framework, shall we ?
In the above patch, it renames a lot of functions that are being
used in memory and
cpu hotplug patches. I think we can push memory and cpu hotplug
jobs, and in the
next phase, let's improve the framework.
And of course, the problem I mentioned above should also be put in
the next phase.
So I want to submit the next version memory hotplug patches based
on the original
framework, and help to improve it in the next phase.
How do you think ?
>
> And then on top of it add hotplug_handler_unplug() that would
> handle actual device removal when ACPI asks for it.
>
> I'm working now on doing above for PCIDevices since they have
> the same workflow (expect to submit patches next week) and
> it looks like we would need to use the same approach for CPU
> unplug as well.
>
>
>
next prev parent reply other threads:[~2014-09-24 7:03 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-27 8:08 [Qemu-devel] [RESEND PATCH v3 0/8] QEmu memory hot unplug support Tang Chen
2014-08-27 8:08 ` [Qemu-devel] [RESEND PATCH v3 1/8] acpi, piix4: Add memory hot unplug support for piix4 Tang Chen
2014-09-04 12:15 ` Igor Mammedov
2014-09-16 3:17 ` Tang Chen
2014-08-27 8:08 ` [Qemu-devel] [RESEND PATCH v3 2/8] acpi, ich9: Add memory hot unplug support for ich9 Tang Chen
2014-09-04 12:25 ` Igor Mammedov
2014-09-16 3:18 ` Tang Chen
2014-08-27 8:08 ` [Qemu-devel] [RESEND PATCH v3 3/8] pc: Add memory hot unplug support for pc machine Tang Chen
2014-09-04 12:44 ` Igor Mammedov
2014-09-04 13:16 ` Igor Mammedov
2014-08-27 8:08 ` [Qemu-devel] [RESEND PATCH v3 4/8] qdev: Add memory hot unplug support for bus-less devices Tang Chen
2014-09-04 13:22 ` Igor Mammedov
2014-09-16 8:42 ` Tang Chen
2014-08-27 8:08 ` [Qemu-devel] [RESEND PATCH v3 5/8] pc-dimm: Add pc_dimm_unrealize() for memory hot unplug support Tang Chen
2014-09-04 13:28 ` Igor Mammedov
2014-09-12 5:30 ` zhanghailiang
2014-09-12 13:17 ` Igor Mammedov
2014-09-24 7:02 ` Tang Chen [this message]
2014-08-27 8:08 ` [Qemu-devel] [RESEND PATCH v3 6/8] acpi: Add hardware implementation for memory hot unplug Tang Chen
2014-09-04 14:20 ` Igor Mammedov
2014-09-16 10:12 ` Tang Chen
2014-09-16 11:34 ` Igor Mammedov
2014-08-27 8:08 ` [Qemu-devel] [RESEND PATCH v3 7/8] pc, acpi bios: Add memory hot unplug interface Tang Chen
2014-09-04 13:53 ` Igor Mammedov
2014-08-27 8:08 ` [Qemu-devel] [RESEND PATCH v3 8/8] monitor: Add memory hot unplug support for device_del command Tang Chen
2014-09-04 14:02 ` Igor Mammedov
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=54226C99.90508@cn.fujitsu.com \
--to=tangchen@cn.fujitsu.com \
--cc=hutao@cn.fujitsu.com \
--cc=imammedo@redhat.com \
--cc=isimatu.yasuaki@jp.fujitsu.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=zhang.zhanghailiang@huawei.com \
--cc=zhugh.fnst@cn.fujitsu.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 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.