[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH v2 20/23] spapr: Remove vCPU objects after C
From: |
David Gibson |
Subject: |
Re: [Qemu-devel] [RFC PATCH v2 20/23] spapr: Remove vCPU objects after CPU hot unplug |
Date: |
Wed, 25 Mar 2015 16:46:09 +1100 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Mon, Mar 23, 2015 at 07:06:01PM +0530, Bharata B Rao wrote:
> Release the vCPU objects after CPU hot unplug so that vCPU fd
> can be parked and reused.
>
> Signed-off-by: Bharata B Rao <address@hidden>
I think this patch is simple enough it should just be folded in with
the previous one.
> ---
> hw/ppc/spapr.c | 19 ++++++++++++++++++-
> 1 file changed, 18 insertions(+), 1 deletion(-)
>
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 7b8784d..3e56d9e 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -1886,6 +1886,23 @@ static void spapr_cpu_hotplug_add(DeviceState *dev,
> CPUState *cs, Error **errp)
> }
> }
>
> +static void spapr_cpu_release(DeviceState *dev, void *opaque)
> +{
> + CPUState *cs;
> + int i;
> + int id = ppc_get_vcpu_dt_id(POWERPC_CPU(CPU(dev)));
> +
> + for (i = id; i < id + smp_threads; i++) {
> + CPU_FOREACH(cs) {
> + PowerPCCPU *cpu = POWERPC_CPU(cs);
> +
> + if (i == ppc_get_vcpu_dt_id(cpu)) {
> + cpu_remove(cs);
> + }
> + }
> + }
> +}
> +
> static void spapr_cpu_hotplug_remove(DeviceState *dev, CPUState *cs,
> Error **errp)
> {
> @@ -1895,7 +1912,7 @@ static void spapr_cpu_hotplug_remove(DeviceState *dev,
> CPUState *cs,
> spapr_dr_connector_by_id(SPAPR_DR_CONNECTOR_TYPE_CPU, id);
> sPAPRDRConnectorClass *drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc);
>
> - drck->detach(drc, dev, NULL, NULL, errp);
> + drck->detach(drc, dev, spapr_cpu_release, NULL, errp);
> }
>
> static void spapr_cpu_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
--
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
pgpFkJyLkW20L.pgp
Description: PGP signature
- Re: [Qemu-devel] [RFC PATCH v2 14/23] cpus: Convert cpu_index into a bitmap, (continued)
- [Qemu-devel] [RFC PATCH v2 18/23] xics_kvm: Add cpu_destroy method to XICS, Bharata B Rao, 2015/03/23
- [Qemu-devel] [RFC PATCH v2 20/23] spapr: Remove vCPU objects after CPU hot unplug, Bharata B Rao, 2015/03/23
- Re: [Qemu-devel] [RFC PATCH v2 20/23] spapr: Remove vCPU objects after CPU hot unplug,
David Gibson <=
- [Qemu-devel] [RFC PATCH v2 19/23] spapr: CPU hot unplug support, Bharata B Rao, 2015/03/23
- [Qemu-devel] [RFC PATCH v2 22/23] spapr: Support ibm, dynamic-reconfiguration-memory, Bharata B Rao, 2015/03/23
[Qemu-devel] [RFC PATCH v2 23/23] spapr: Memory hotplug support, Bharata B Rao, 2015/03/23
[Qemu-devel] [RFC PATCH v2 21/23] spapr: Initialize hotplug memory address space, Bharata B Rao, 2015/03/23