From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45132) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFaDX-0007Tn-BC for qemu-devel@nongnu.org; Sun, 25 Jan 2015 22:20:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YFaDT-0003q6-29 for qemu-devel@nongnu.org; Sun, 25 Jan 2015 22:19:59 -0500 Received: from mailpro.odiso.net ([89.248.209.98]:57115) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFaDS-0003pq-QH for qemu-devel@nongnu.org; Sun, 25 Jan 2015 22:19:55 -0500 Date: Mon, 26 Jan 2015 04:19:52 +0100 (CET) From: Alexandre DERUMIER Message-ID: <1405516216.5166135.1422242392438.JavaMail.zimbra@oxygem.tv> In-Reply-To: <1931909388.5166129.1422242365253.JavaMail.zimbra@oxygem.tv> References: <884906902.4955995.1422008657285.JavaMail.zimbra@oxygem.tv> <1422237708.23881.5.camel@G08FNSTD140041> 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 Thanks for your reply. 2 others things: 1) on cpu unplug, I see that the cpu is correctly removed from my linux guest = but not from qemu starting with a guest with 3cpus: guest: #ls -lah /sys/devices/system/ |grep cpu drwxr-xr-x 6 root root 0 Jan 25 22:16 cpu0 drwxr-xr-x 6 root root 0 Jan 25 22:16 cpu1 drwxr-xr-x 6 root root 0 Jan 25 22:16 cpu2 hmp: # info cpus * CPU #0: pc=3D0xffffffff81057022 (halted) thread_id=3D24972 CPU #1: pc=3D0xffffffff81057022 (halted) thread_id=3D24973 CPU #2: pc=3D0xffffffff81048bc1 (halted) thread_id=3D25102 then unplug cpu2 hmp : device_del cpu2 guest: dmesg: [ 176.219754] Unregister pv shared memory for cpu 2 [ 176.278881] smpboot: CPU 2 is now offline #ls -lah /sys/devices/system/ |grep cpu drwxr-xr-x 6 root root 0 Jan 25 22:16 cpu0 drwxr-xr-x 6 root root 0 Jan 25 22:16 cpu1 hmp: # info cpus * CPU #0: pc=3D0xffffffff81057022 (halted) thread_id=3D24972 CPU #1: pc=3D0xffffffff81057022 (halted) thread_id=3D24973 CPU #2: pc=3D0xffffffff81048bc1 (halted) thread_id=3D25102 2)when numa is used, the hotplugged cpu is always on numa node 0 (cpu_add or device_add cpu) starting a guest, with 2 sockets,1 cores -smp 2,sockets=3D2,cores=3D1,maxcpus=3D2 -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: # info numa 2 nodes node 0 cpus: 0 node 0 size: 256 MB node 1 cpus: 1 node 1 size: 256 MB ok now starting with same topology, but with 1cpu at start -smp 2,sockets=3D2,cores=3D1,maxcpus=3D2 -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 2 nodes node 0 cpus: 0 node 0 size: 256 MB node 1 cpus:=20 node 1 size: 256 MB hotpluging a cpu # device_add kvm64-x86_64-cpu,apic-id=3D1,id=3Dcpu1 # info numa 2 nodes node 0 cpus: 0 1 node 0 size: 256 MB node 1 cpus:=20 node 1 size: 256 MB cpu1 should be on node1, not node0. Regards, Alexandre ----- Mail original ----- De: "Zhu Guihua" =C3=80: "aderumier" 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 03:01:48 Objet: Re: [Qemu-devel] [PATCH v2 00/11] cpu: add i386 cpu hot remove suppo= rt 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