Suppose all the QEMU threads of both VMs run on separate CPUs (which should be guaranteed by the vcpu pinning in the XML), I am trying to think of a resource that can be shared between the 2 VMs. The only thing that comes into my mind is memory.
I saw that the RAM allocation for the VMs is done from the AnonHugePages and not from the old mechanism of regular Hugepages. May this somehow relate to my problem? Waiting for your comments, Thanks, Yan From: Yan Fridland Sent: Wednesday, July 27, 2016 10:17 AM To: 'Yadi'; qemu-discuss@nongnu.org Subject: RE: [Qemu-discuss] [problem]-starting a VM causes RT (latency) problem for application running on another VM This is my mistake. I actually got confused because what I saw is a "swapper" process which apparently has nothing to do with SWAP, rather than being just an IDLE process in a system. It started running after the application crashed, so it’s a consequence and not the root cause. Besides what I saw in top it actually refers to the cache memory rather than to the swap region so it makes sense. Meaning, I still don’t know what happened and open to your advices. From: Yadi [mailto:yadi...@windriver.com] Sent: Wednesday, July 27, 2016 4:15 AM To: Yan Fridland; qemu-discuss@nongnu.org<mailto:qemu-discuss@nongnu.org> Subject: Re: [Qemu-discuss] [problem]-starting a VM causes RT (latency) problem for application running on another VM swapper process? could I reproduce it on my side? what is operating Environment ? Yadi On 2016年07月26日 23:50, Yan Fridland wrote: Looks like I saw the reason for that but I have no idea why this is happening. Immediately after running "virsh start VM2" I saw on VM1 a swapper thread running for a lot of time causing this delay and another thing when I checked "top" before and after I saw a drop in a free RAM memory and increase in a SWAP available memory (both by ~100M). this explains why the swapper showed up. BUT how can you explain such behavior if I have totally isolated VMs running with 4G RAM each when on the HOST I have ~60G of free RAM space? Is it possible that both QEMUs try to allocate a shared memory region in HOSTs RAM that causes such interference ? Thanks, Yan From: Yadi [mailto:yadi...@windriver.com] Sent: Tuesday, July 26, 2016 12:24 PM To: qemu-discuss@nongnu.org<mailto:qemu-discuss@nongnu.org>; Yan Fridland Subject: Re: [Qemu-discuss] [problem]-starting a VM causes RT (latency) problem for application running on another VM On 2016年07月26日 15:48, Yan Fridland wrote: Hi Yadi, Thanks a lot for your comment. Actually I am doing emulator pin to the QEMU process in the XML: <vcpu placement='static'>3</vcpu> <cputune> <vcpupin vcpu='0' cpuset='1'/> <vcpupin vcpu='1' cpuset='2'/> <vcpupin vcpu='2' cpuset='3'/> <emulatorpin cpuset='8'/> <vcpusched vcpus='1-2' scheduler='fifo' priority='99'/> </cputune> BUT, looks like it doesn’t help. Is there any way to make ALL the related QEMU threads run within the scope of cores 1,2,3,8 ONLY in the above example? it is so wired, I have no better ways to handle it since I have no experienced the similar issue as your. so, just two suggestion for you: 1: check all qemu thread associated entries under cgroup filesystem, sure that cpusets are correctly set. 2: if 1 fails, it may means there is nothing left to do, ftrace for schduler. whatever result, let me know please. I am very interesting in the issue. Yadi Thanks, Yan From: Yadi [mailto:yadi...@windriver.com] Sent: Tuesday, July 26, 2016 6:12 AM To: Yan Fridland; qemu-discuss@nongnu.org<mailto:qemu-discuss@nongnu.org> Subject: Re: [Qemu-discuss] [problem]-starting a VM causes RT (latency) problem for application running on another VM On 2016年07月25日 23:03, Yan Fridland wrote: Hello All, Here is a problem I saw when I ran virsh start to a VM. I have 2VMs on a server when one of them is running a RT application and the other is in shut down state. Then I executed "virsh start" to the second VM and saw 2-3 seconds later a big latency problem in my RT application running on the first VM. I want to emphasize that the VMs use dedicated isolated cores of the server and I have the relevant configuration on the server and the vcpu pinning section of virsh xml. Can anyone tell me why I experience such behavior and how it can be resolved? I will highly appreciate your help. Thank you, Yan I am not very sure, but I suggest you to add emulatorpin in xml file, then see results. actually, all qemu associated process can use all processors via cgroup configure created by libvirt, https://libvirt.org/formatdomain.html#elementsCPUTuning