[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [Qemu-devel] [PATCH v6 05/11] cpu: Reclaim vCPU objects
From: |
Matthew Rosato |
Subject: |
Re: [Qemu-ppc] [Qemu-devel] [PATCH v6 05/11] cpu: Reclaim vCPU objects |
Date: |
Wed, 27 Jan 2016 11:31:41 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 |
On 01/08/2016 01:55 AM, Bharata B Rao wrote:
> From: Gu Zheng <address@hidden>
>
> In order to deal well with the kvm vcpus (which can not be removed without any
> protection), we do not close KVM vcpu fd, just record and mark it as stopped
> into a list, so that we can reuse it for the appending cpu hot-add request if
> possible. It is also the approach that kvm guys suggested:
> https://www.mail-archive.com/address@hidden/msg102839.html
>
> Signed-off-by: Chen Fan <address@hidden>
> Signed-off-by: Gu Zheng <address@hidden>
> Signed-off-by: Zhu Guihua <address@hidden>
> Signed-off-by: Bharata B Rao <address@hidden>
> [- Explicit CPU_REMOVE() from qemu_kvm/tcg_destroy_vcpu()
> isn't needed as it is done from cpu_exec_exit()
> - Use iothread mutex instead of global mutex during
> destroy
> - Don't cleanup vCPU object from vCPU thread context
> but leave it to the callers (device_add/device_del)]
> ---
> cpus.c | 38 +++++++++++++++++++++++++++++++++++
> include/qom/cpu.h | 10 +++++++++
> include/sysemu/kvm.h | 1 +
> kvm-all.c | 57
> +++++++++++++++++++++++++++++++++++++++++++++++++++-
> kvm-stub.c | 5 +++++
> 5 files changed, 110 insertions(+), 1 deletion(-)
>
> diff --git a/cpus.c b/cpus.c
> index ea29584..12374af 100644
> --- a/cpus.c
> +++ b/cpus.c
> @@ -953,6 +953,18 @@ void async_run_on_cpu(CPUState *cpu, void (*func)(void
> *data), void *data)
> qemu_cpu_kick(cpu);
> }
>
> +static void qemu_kvm_destroy_vcpu(CPUState *cpu)
> +{
> + if (kvm_destroy_vcpu(cpu) < 0) {
> + error_report("kvm_destroy_vcpu failed.\n");
FYI, checkpatch fails here -- no need for the newline.
Matt
- [Qemu-ppc] [PATCH v6 08/11] target-ppc: Introduce PowerPC specific CPU core device, (continued)
- [Qemu-ppc] [PATCH v6 08/11] target-ppc: Introduce PowerPC specific CPU core device, Bharata B Rao, 2016/01/08
- [Qemu-ppc] [PATCH v6 04/11] cpu: Don't realize CPU from cpu_generic_init(), Bharata B Rao, 2016/01/08
- [Qemu-ppc] [PATCH v6 05/11] cpu: Reclaim vCPU objects, Bharata B Rao, 2016/01/08
- [Qemu-ppc] [PATCH v6 02/11] exec: Remove cpu from cpus list during cpu_exec_exit(), Bharata B Rao, 2016/01/08
- [Qemu-ppc] [PATCH v6 10/11] spapr: CPU hotplug support, Bharata B Rao, 2016/01/08
- [Qemu-ppc] [PATCH v6 01/11] machine: Don't allow CPU toplogies with partially filled cores, Bharata B Rao, 2016/01/08