From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46094) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFaIs-0001E4-8e for qemu-devel@nongnu.org; Sun, 25 Jan 2015 22:25:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YFaIo-0005nc-B1 for qemu-devel@nongnu.org; Sun, 25 Jan 2015 22:25:30 -0500 Received: from mailpro.odiso.net ([89.248.209.98]:57336) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFaIo-0005nS-2p for qemu-devel@nongnu.org; Sun, 25 Jan 2015 22:25:26 -0500 Date: Mon, 26 Jan 2015 04:25:24 +0100 (CET) From: Alexandre DERUMIER Message-ID: <611307413.5166152.1422242724858.JavaMail.zimbra@oxygem.tv> In-Reply-To: <1405516216.5166135.1422242392438.JavaMail.zimbra@oxygem.tv> References: <884906902.4955995.1422008657285.JavaMail.zimbra@oxygem.tv> <1422237708.23881.5.camel@G08FNSTD140041> <1405516216.5166135.1422242392438.JavaMail.zimbra@oxygem.tv> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 00/11] cpu: add i386 cpu hot remove support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Zhu Guihua Cc: qemu-devel , tangchen@cn.fujitsu.com, chen fan fnst , isimatu yasuaki , Igor Mammedov , guz fnst , Anshul Makkar , afaerber >>2)when numa is used, the hotplugged cpu is always on numa node 0=20 >>(cpu_add or device_add cpu)=20 About this, it seem to be a display bug in "info numa", cpu is correctly assigned to numa node1 in the guest. ----- Mail original ----- De: "aderumier" =C3=80: "Zhu Guihua" Cc: "qemu-devel" , tangchen@cn.fujitsu.com, "guz fns= t" , "isimatu yasuaki" , "Anshul Makkar" , "chen fan fnst" , "Igor Mammedov" , "afaer= ber" Envoy=C3=A9: Lundi 26 Janvier 2015 04:19:52 Objet: Re: [Qemu-devel] [PATCH v2 00/11] cpu: add i386 cpu hot remove suppo= rt Thanks for your reply.=20 2 others things:=20 1)=20 on cpu unplug, I see that the cpu is correctly removed from my linux guest = but not from qemu=20 starting with a guest with 3cpus:=20 guest: #ls -lah /sys/devices/system/ |grep cpu=20 drwxr-xr-x 6 root root 0 Jan 25 22:16 cpu0=20 drwxr-xr-x 6 root root 0 Jan 25 22:16 cpu1=20 drwxr-xr-x 6 root root 0 Jan 25 22:16 cpu2=20 hmp: # info cpus=20 * CPU #0: pc=3D0xffffffff81057022 (halted) thread_id=3D24972=20 CPU #1: pc=3D0xffffffff81057022 (halted) thread_id=3D24973=20 CPU #2: pc=3D0xffffffff81048bc1 (halted) thread_id=3D25102=20 then unplug cpu2=20 hmp : device_del cpu2=20 guest:=20 dmesg:=20 [ 176.219754] Unregister pv shared memory for cpu 2=20 [ 176.278881] smpboot: CPU 2 is now offline=20 #ls -lah /sys/devices/system/ |grep cpu=20 drwxr-xr-x 6 root root 0 Jan 25 22:16 cpu0=20 drwxr-xr-x 6 root root 0 Jan 25 22:16 cpu1=20 hmp: # info cpus=20 * CPU #0: pc=3D0xffffffff81057022 (halted) thread_id=3D24972=20 CPU #1: pc=3D0xffffffff81057022 (halted) thread_id=3D24973=20 CPU #2: pc=3D0xffffffff81048bc1 (halted) thread_id=3D25102=20 2)when numa is used, the hotplugged cpu is always on numa node 0=20 (cpu_add or device_add cpu)=20 starting a guest, with 2 sockets,1 cores=20 -smp 2,sockets=3D2,cores=3D1,maxcpus=3D2=20 -object memory-backend-ram,size=3D256M,id=3Dram-node0 -numa node,nodeid=3D0= ,cpus=3D0,memdev=3Dram-node0=20 -object memory-backend-ram,size=3D256M,id=3Dram-node1 -numa node,nodeid=3D1= ,cpus=3D1,memdev=3Dram-node1=20 hmp:=20 # info numa=20 2 nodes=20 node 0 cpus: 0=20 node 0 size: 256 MB=20 node 1 cpus: 1=20 node 1 size: 256 MB=20 ok=20 now=20 starting with same topology, but with 1cpu at start=20 -smp 2,sockets=3D2,cores=3D1,maxcpus=3D2=20 -object memory-backend-ram,size=3D256M,id=3Dram-node0 -numa node,nodeid=3D0= ,cpus=3D0,memdev=3Dram-node0=20 -object memory-backend-ram,size=3D256M,id=3Dram-node1 -numa node,nodeid=3D1= ,cpus=3D1,memdev=3Dram-node1=20 # info numa=20 2 nodes=20 node 0 cpus: 0=20 node 0 size: 256 MB=20 node 1 cpus:=20 node 1 size: 256 MB=20 hotpluging a cpu=20 # device_add kvm64-x86_64-cpu,apic-id=3D1,id=3Dcpu1=20 # info numa=20 2 nodes=20 node 0 cpus: 0 1=20 node 0 size: 256 MB=20 node 1 cpus:=20 node 1 size: 256 MB=20 cpu1 should be on node1, not node0.=20 Regards,=20 Alexandre=20 ----- Mail original -----=20 De: "Zhu Guihua" =20 =C3=80: "aderumier" =20 Cc: "qemu-devel" , tangchen@cn.fujitsu.com, "guz fns= t" , "isimatu yasuaki" , "Anshul Makkar" , "chen fan fnst" , "Igor Mammedov" , "afaer= ber" =20 Envoy=C3=A9: Lundi 26 Janvier 2015 03:01:48=20 Objet: Re: [Qemu-devel] [PATCH v2 00/11] cpu: add i386 cpu hot remove suppo= rt=20 On Fri, 2015-01-23 at 11:24 +0100, Alexandre DERUMIER wrote:=20 > Hello,=20 >=20 > I'm currently testing the new cpu unplug features,=20 > Works fine here with debian guests and kernel 3.14.=20 >=20 Thanks for your test.=20 > But I have notice some small potential bugs, but I'm not sure I'm doing i= t right.=20 >=20 > 1)first, to unplug cpu, we need an id for cpu=20 >=20 Yes, if you want to unplug cpu, you must have an id for cpu.=20 > The problem is that the current qemu command line=20 > -smp 1,sockets=3D2,cores=3D1,maxcpus=3D2=20 >=20 > for example, will create 1 cpu on apic-id 0 without any id, so we can't u= nplug it.=20 >=20 >=20 > So, I have tried with=20 >=20 > -smp 1,sockets=3D2,cores=3D1,maxcpus=3D2 -device kvm64-x86_64-cpu,apic-id= =3D0,id=3Dcpu0=20 >=20 > But this give me an error:=20 > "-device kvm64-x86_64-cpu,apic-id=3D0,id=3Dcpu0: CPU with APIC ID 0 exist= s"=20 >=20 APIC ID 0 was used by the cpu of '-smp 1'.=20 So you should use apic-id=3D1=20 > (also try to set -smp 0, but it's not working).=20 >=20 >=20 >=20 > 2) second problem, if I start with=20 > -smp 1,sockets=3D2,cores=3D1,maxcpus=3D2=20 >=20 > then hmp:=20 > device_add kvm64-x86_64-cpu,apic-id=3D1,id=3Dcpu1=20 >=20 > then hmp : device_del cpu1=20 >=20 > Got an error:"=20 > This is the last cpu, should not be removed!"=20 >=20 >=20 Oh, it's our problem, thanks for your pointing out.=20 I will fix it in next version.=20 Regards,=20 Zhu=20 >=20 > This is coming from=20 > [PATCH 06/12] pc: add cpu hot unplug request callback support=20 > + if (smp_cpus =3D=3D 1) {=20 > + error_setg(&local_err,=20 > + "This is the last cpu, should not be removed!");=20 > + goto out;=20 > + }=20 >=20 >=20 >=20 > So, the only way unplug is working for me, is to start with -smp 2 minimu= m=20 > -smp 2,sockets=3D2,cores=3D1,maxcpus=3D4=20 >=20 > Then I can hotplug|unplug cpuid >=3D 2=20 >=20 >=20 >=20 > Regards,=20 >=20 > Alexandre Derumier=20 [...]=20