Re: [Qemu-devel] [RFC V2 10/10] cpus: reclaim allocated vCPU objects

2014-12-08 Thread Gu Zheng
+cc Gleb, KVM guys, On 12/09/2014 12:38 AM, Peter Maydell wrote: > On 8 December 2014 at 15:38, Igor Mammedov wrote: >> On Mon, 8 Dec 2014 10:50:21 + >> Peter Maydell wrote: >>> Why can't the kernel handle our just destroying the vcpu and >>> later recreating it if necessary? That seems the

Re: [Qemu-devel] [RFC V2 10/10] cpus: reclaim allocated vCPU objects

2014-12-08 Thread Peter Maydell
On 8 December 2014 at 15:38, Igor Mammedov wrote: > On Mon, 8 Dec 2014 10:50:21 + > Peter Maydell wrote: >> Why can't the kernel handle our just destroying the vcpu and >> later recreating it if necessary? That seems the more logical >> approach than trying to keep fds hanging around in users

Re: [Qemu-devel] [RFC V2 10/10] cpus: reclaim allocated vCPU objects

2014-12-08 Thread Igor Mammedov
On Mon, 8 Dec 2014 10:50:21 + Peter Maydell wrote: > On 8 December 2014 at 10:28, Gu Zheng wrote: > > Yes, it's a limitation now, but it is not the final implementation. > > As to the QEMU side, the vcpu object in kernel is stateless, and a > > reset operation will be done when we hot add a

Re: [Qemu-devel] [RFC V2 10/10] cpus: reclaim allocated vCPU objects

2014-12-08 Thread Peter Maydell
On 8 December 2014 at 10:28, Gu Zheng wrote: > Yes, it's a limitation now, but it is not the final implementation. > As to the QEMU side, the vcpu object in kernel is stateless, and a > reset operation will be done when we hot add a vcpu, so I think we > can kill the limitation, just choose a park

Re: [Qemu-devel] [RFC V2 10/10] cpus: reclaim allocated vCPU objects

2014-12-08 Thread Gu Zheng
Hi Peter, On 12/08/2014 05:26 PM, Peter Maydell wrote: > On 8 December 2014 at 09:16, Bharata B Rao wrote: >> So this approach of parking the vcpu fd in QEMU and reusing it next >> time during CPU hotplug will only work if all architectures supported >> by KVM driver are ok with reuse of vcpu obj

Re: [Qemu-devel] [RFC V2 10/10] cpus: reclaim allocated vCPU objects

2014-12-08 Thread Gu Zheng
Hi Bharata, On 12/08/2014 05:16 PM, Bharata B Rao wrote: > On Thu, Aug 28, 2014 at 9:06 AM, Gu Zheng wrote: >> After ACPI get a signal to eject a vCPU, the vCPU must be >> removed from CPU list,before the vCPU really removed, then >> release the all related vCPU objects. >> But we do not close K

Re: [Qemu-devel] [RFC V2 10/10] cpus: reclaim allocated vCPU objects

2014-12-08 Thread Peter Maydell
On 8 December 2014 at 09:16, Bharata B Rao wrote: > So this approach of parking the vcpu fd in QEMU and reusing it next > time during CPU hotplug will only work if all architectures supported > by KVM driver are ok with reuse of vcpu object in the kernel. I am > using relevant bits of this patch o

Re: [Qemu-devel] [RFC V2 10/10] cpus: reclaim allocated vCPU objects

2014-12-08 Thread Bharata B Rao
On Thu, Aug 28, 2014 at 9:06 AM, Gu Zheng wrote: > After ACPI get a signal to eject a vCPU, the vCPU must be > removed from CPU list,before the vCPU really removed, then > release the all related vCPU objects. > But we do not close KVM vcpu fd, just record it into a list, in > order to reuse it.

Re: [Qemu-devel] [RFC V2 10/10] cpus: reclaim allocated vCPU objects

2014-09-15 Thread Anshul Makkar
Great !! Anshul Makkar On Mon, Sep 15, 2014 at 3:53 PM, Bharata B Rao wrote: > On Mon, Sep 15, 2014 at 4:03 PM, Anshul Makkar > wrote: > > That explains the cause. > > > > Please verify you have the iasl compiler installed and are not using the > > hold .hex (compile .dsl ) files. (Faced this

Re: [Qemu-devel] [RFC V2 10/10] cpus: reclaim allocated vCPU objects

2014-09-15 Thread Bharata B Rao
On Mon, Sep 15, 2014 at 4:03 PM, Anshul Makkar wrote: > That explains the cause. > > Please verify you have the iasl compiler installed and are not using the > hold .hex (compile .dsl ) files. (Faced this issue in our build setup using > sbuil.). > > I hope you have verified that your .dsl file ha

Re: [Qemu-devel] [RFC V2 10/10] cpus: reclaim allocated vCPU objects

2014-09-15 Thread Anshul Makkar
That explains the cause. Please verify you have the iasl compiler installed and are not using the hold .hex (compile .dsl ) files. (Faced this issue in our build setup using sbuil.). I hope you have verified that your .dsl file has the changes as mentioned in the patch. I have also verified with

Re: [Qemu-devel] [RFC V2 10/10] cpus: reclaim allocated vCPU objects

2014-09-15 Thread Bharata B Rao
On Mon, Sep 15, 2014 at 12:09 PM, Gu Zheng wrote: > Hi Bharata, > On 09/12/2014 09:52 PM, Bharata B Rao wrote: > >> On Fri, Sep 12, 2014 at 4:23 PM, Anshul Makkar >> wrote: >>> During plugging we can see this event: echo 1 > cpu8/online. >>> >>> But during unplugging , we can't see the event echo

Re: [Qemu-devel] [RFC V2 10/10] cpus: reclaim allocated vCPU objects

2014-09-14 Thread Gu Zheng
Hi Bharata, On 09/12/2014 09:52 PM, Bharata B Rao wrote: > On Fri, Sep 12, 2014 at 4:23 PM, Anshul Makkar > wrote: >> During plugging we can see this event: echo 1 > cpu8/online. >> >> But during unplugging , we can't see the event echo 0 > cpu8/online. > > That's because I didn't do that explic

Re: [Qemu-devel] [RFC V2 10/10] cpus: reclaim allocated vCPU objects

2014-09-14 Thread Gu Zheng
Hi Igor, On 09/12/2014 10:15 PM, Igor Mammedov wrote: > On Thu, 28 Aug 2014 11:36:42 +0800 > Gu Zheng wrote: > >> After ACPI get a signal to eject a vCPU, the vCPU must be >> removed from CPU list,before the vCPU really removed, then >> release the all related vCPU objects. >> But we do not clo

Re: [Qemu-devel] [RFC V2 10/10] cpus: reclaim allocated vCPU objects

2014-09-12 Thread Anshul Makkar
I have tested with 3.11 kernel, Kernel should be fine.. But it wouldn't harm testing with latest kernel, may be it can provide some extra hints.. Anshul Makkar On Fri, Sep 12, 2014 at 3:52 PM, Bharata B Rao wrote: > On Fri, Sep 12, 2014 at 4:23 PM, Anshul Makkar > wrote: > > During plugging we

Re: [Qemu-devel] [RFC V2 10/10] cpus: reclaim allocated vCPU objects

2014-09-12 Thread Igor Mammedov
On Thu, 28 Aug 2014 11:36:42 +0800 Gu Zheng wrote: > After ACPI get a signal to eject a vCPU, the vCPU must be > removed from CPU list,before the vCPU really removed, then > release the all related vCPU objects. > But we do not close KVM vcpu fd, just record it into a list, in > order to reuse i

Re: [Qemu-devel] [RFC V2 10/10] cpus: reclaim allocated vCPU objects

2014-09-12 Thread Bharata B Rao
On Fri, Sep 12, 2014 at 4:23 PM, Anshul Makkar wrote: > During plugging we can see this event: echo 1 > cpu8/online. > > But during unplugging , we can't see the event echo 0 > cpu8/online. That's because I didn't do that explicitly, was always trying to remove an online cpu from the monitor w/o

Re: [Qemu-devel] [RFC V2 10/10] cpus: reclaim allocated vCPU objects

2014-09-12 Thread Anshul Makkar
During plugging we can see this event: echo 1 > cpu8/online. But during unplugging , we can't see the event echo 0 > cpu8/online. Just for additional check, in my code I have added following udev rule echo 0 > cpu[0-9]*/online. May be this is of any help. Thanks Anshul Makkar On Fri, Sep 12,

Re: [Qemu-devel] [RFC V2 10/10] cpus: reclaim allocated vCPU objects

2014-09-12 Thread Bharata B Rao
On Fri, Sep 12, 2014 at 3:23 PM, Gu Zheng wrote: > Hi Bharata, > On 09/12/2014 04:09 PM, Bharata B Rao wrote: > >> On Fri, Sep 12, 2014 at 6:54 AM, Gu Zheng wrote: >>> Is guest os enabled acpi cpu hotplug? What's the guest's cpu info? >>> Please try latest QEMU, and any feedback is welcome. >>> >

Re: [Qemu-devel] [RFC V2 10/10] cpus: reclaim allocated vCPU objects

2014-09-12 Thread Gu Zheng
Hi Bharata, On 09/12/2014 04:09 PM, Bharata B Rao wrote: > On Fri, Sep 12, 2014 at 6:54 AM, Gu Zheng wrote: >> Is guest os enabled acpi cpu hotplug? What's the guest's cpu info? >> Please try latest QEMU, and any feedback is welcome. >> > > Tried with latest QEMU git + your patchset and Fedora 2

Re: [Qemu-devel] [RFC V2 10/10] cpus: reclaim allocated vCPU objects

2014-09-12 Thread Bharata B Rao
On Fri, Sep 12, 2014 at 6:54 AM, Gu Zheng wrote: > Is guest os enabled acpi cpu hotplug? What's the guest's cpu info? > Please try latest QEMU, and any feedback is welcome. > Tried with latest QEMU git + your patchset and Fedora 20 guest, but QEMU monitor still shows the removed CPU. Guest kerne

Re: [Qemu-devel] [RFC V2 10/10] cpus: reclaim allocated vCPU objects

2014-09-11 Thread Gu Zheng
Hi Bharata, On 09/11/2014 08:37 PM, Bharata B Rao wrote: > On Thu, Sep 11, 2014 at 3:23 PM, Gu Zheng wrote: >> On 09/11/2014 05:35 PM, Bharata B Rao wrote: >> >>> On Thu, Aug 28, 2014 at 9:06 AM, Gu Zheng wrote: After ACPI get a signal to eject a vCPU, the vCPU must be removed from CP

Re: [Qemu-devel] [RFC V2 10/10] cpus: reclaim allocated vCPU objects

2014-09-11 Thread Bharata B Rao
On Thu, Sep 11, 2014 at 3:23 PM, Gu Zheng wrote: > On 09/11/2014 05:35 PM, Bharata B Rao wrote: > >> On Thu, Aug 28, 2014 at 9:06 AM, Gu Zheng wrote: >>> After ACPI get a signal to eject a vCPU, the vCPU must be >>> removed from CPU list,before the vCPU really removed, then >>> release the all r

Re: [Qemu-devel] [RFC V2 10/10] cpus: reclaim allocated vCPU objects

2014-09-11 Thread Gu Zheng
On 09/11/2014 05:35 PM, Bharata B Rao wrote: > On Thu, Aug 28, 2014 at 9:06 AM, Gu Zheng wrote: >> After ACPI get a signal to eject a vCPU, the vCPU must be >> removed from CPU list,before the vCPU really removed, then >> release the all related vCPU objects. >> But we do not close KVM vcpu fd,

Re: [Qemu-devel] [RFC V2 10/10] cpus: reclaim allocated vCPU objects

2014-09-11 Thread Anshul Makkar
Bharata, this not expected. info cpus should indicate report proper number of cpus after deletion. Anshul Makkar On Thu, Sep 11, 2014 at 11:35 AM, Bharata B Rao wrote: > from

Re: [Qemu-devel] [RFC V2 10/10] cpus: reclaim allocated vCPU objects

2014-09-11 Thread Gu Zheng
On 09/11/2014 05:35 PM, Bharata B Rao wrote: > On Thu, Aug 28, 2014 at 9:06 AM, Gu Zheng wrote: >> After ACPI get a signal to eject a vCPU, the vCPU must be >> removed from CPU list,before the vCPU really removed, then >> release the all related vCPU objects. >> But we do not close KVM vcpu fd,

Re: [Qemu-devel] [RFC V2 10/10] cpus: reclaim allocated vCPU objects

2014-09-11 Thread Bharata B Rao
On Thu, Aug 28, 2014 at 9:06 AM, Gu Zheng wrote: > After ACPI get a signal to eject a vCPU, the vCPU must be > removed from CPU list,before the vCPU really removed, then > release the all related vCPU objects. > But we do not close KVM vcpu fd, just record it into a list, in > order to reuse it.

Re: [Qemu-devel] [RFC V2 10/10] cpus: reclaim allocated vCPU objects

2014-09-09 Thread Gu Zheng
Hi Igor, On 09/09/2014 10:40 PM, Igor Mammedov wrote: > On Thu, 28 Aug 2014 11:36:42 +0800 > Gu Zheng wrote: > >> After ACPI get a signal to eject a vCPU, the vCPU must be >> removed from CPU list,before the vCPU really removed, then >> release the all related vCPU objects. >> But we do not cl

Re: [Qemu-devel] [RFC V2 10/10] cpus: reclaim allocated vCPU objects

2014-09-09 Thread Igor Mammedov
On Thu, 28 Aug 2014 11:36:42 +0800 Gu Zheng wrote: > After ACPI get a signal to eject a vCPU, the vCPU must be > removed from CPU list,before the vCPU really removed, then > release the all related vCPU objects. > But we do not close KVM vcpu fd, just record it into a list, in > order to reuse i

[Qemu-devel] [RFC V2 10/10] cpus: reclaim allocated vCPU objects

2014-08-27 Thread Gu Zheng
After ACPI get a signal to eject a vCPU, the vCPU must be removed from CPU list,before the vCPU really removed, then release the all related vCPU objects. But we do not close KVM vcpu fd, just record it into a list, in order to reuse it. Signed-off-by: Chen Fan Signed-off-by: Gu Zheng --- cpus