From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52406) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aeLa3-0000WZ-17 for qemu-devel@nongnu.org; Fri, 11 Mar 2016 06:50:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aeLZy-00021i-PQ for qemu-devel@nongnu.org; Fri, 11 Mar 2016 06:50:06 -0500 References: <1457672078-17307-1-git-send-email-bharata@linux.vnet.ibm.com> <1457672078-17307-4-git-send-email-bharata@linux.vnet.ibm.com> From: Thomas Huth Message-ID: <56E2B0E2.9070901@redhat.com> Date: Fri, 11 Mar 2016 12:49:54 +0100 MIME-Version: 1.0 In-Reply-To: <1457672078-17307-4-git-send-email-bharata@linux.vnet.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH v2 3/9] cpu: Reclaim vCPU objects List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bharata B Rao , qemu-devel@nongnu.org Cc: mjrosato@linux.vnet.ibm.com, Zhu Guihua , pkrempa@redhat.com, ehabkost@redhat.com, aik@ozlabs.ru, armbru@redhat.com, agraf@suse.de, borntraeger@de.ibm.com, qemu-ppc@nongnu.org, Chen Fan , pbonzini@redhat.com, Gu Zheng , imammedo@redhat.com, mdroth@linux.vnet.ibm.com, afaerber@suse.de, david@gibson.dropbear.id.au On 11.03.2016 05:54, Bharata B Rao wrote: > From: Gu Zheng > > 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/kvm@vger.kernel.org/msg102839.html > > Signed-off-by: Chen Fan > Signed-off-by: Gu Zheng > Signed-off-by: Zhu Guihua > Signed-off-by: Bharata B Rao > [- 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 | 39 +++++++++++++++++++++++++++++++++-- > include/qom/cpu.h | 10 +++++++++ > include/sysemu/kvm.h | 1 + > kvm-all.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++- > kvm-stub.c | 5 +++++ > 5 files changed, 109 insertions(+), 3 deletions(-) Reviewed-by: Thomas Huth