From: Avi Kivity <avi@redhat.com>
To: "Zhang, Xiantao" <xiantao.zhang@intel.com>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
Marcelo Tosatti <mtosatti@redhat.com>,
"Yang, Xiaowei" <xiaowei.yang@intel.com>,
"Dong, Eddie" <eddie.dong@intel.com>,
"Li, Xin" <xin.li@intel.com>, Ingo Molnar <mingo@elte.hu>,
Peter Zijlstra <peterz@infradead.org>,
Mike Galbraith <efault@gmx.de>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: VM performance issue in KVM guests.
Date: Sat, 10 Apr 2010 22:27:33 +0300 [thread overview]
Message-ID: <4BC0D125.9050108@redhat.com> (raw)
In-Reply-To: <EB8593BCECAB3D40A8248BE0B6400A3846903F4C@shzsmsx502.ccr.corp.intel.com>
(copying lkml and some scheduler folk)
On 04/10/2010 11:16 AM, Zhang, Xiantao wrote:
> Hi, all
> We are working on the scalability work for KVM guests, and found one big issue exists in linux scheduler and it may impact guest's performance and scalability a lot for some special workloads running in VM. In the current Linux scheduler, there are some features to enhance App's performance which are defined in the file kvm.git/kernel/sched_features.h. Certainly, they are mostly beneficial optimizations to improve system's performance, but unluckily, some of them may hurt VM's performance and scalablity in KVM case
> We know that if two or more vcpus of one guests are scheduled to one same logical processor, same CPU utilization may generate less valid output due mutual lock in VM's OS than that are scheduled to different logical processors .And we also know that VM's vcpus are emulated or executed through the threads of Qemu for KVM. If the vcpu threads of qemu are often pulled to one same logical processor by some features of Linux scheduler, kvm guests'performance may be hurt a lot. In our performance testing, the results also show this performance bottleneck due to this issue.
What was the performance hit? What was your I/O setup (image format,
using aio?)
> After analysis about Linux scheduler, we found it is indeed caused by the known features of Linux schduler, such as AFFINE_WAKEUPS, SYNC_WAKEUPS etc. With these features on, linux schduler often tries to schedule the vcpu threads of one guests to one same logical processor when vcpus are over-committed and logical processors are saturated. Once the vcpu threads of one VM are scheduled to the same LP, system performance drops dramatically with some workloads(like webbench running in windows OS).
>
Were the affine wakeups due to the kernel (emulated guest IPIs) or qemu?
> To verify this finding, we also worked out a simple patch attached in the mail to dynamially switch off the two sheduler features mentioned above when scheduler knows the scheduling tasks are vcpu threads, and we found the the whole system's performance and scalability are improved a lot. Certatinly, this patch is not good for upstream, but it can enlighten us to think how to optimize Linux scheduler and we also want to initiate the discussion about how to make LINUX's scheduler more friendly to virtualization. Besides, this issue maybe not only kvm's special issue, insteadly it should be a common issue for host-based VMs, and we also expect that we can have an elegant solution to thoroughly resolve the performance or scalability gap compared with hypervisor-based VMs.
>
Most likely it also hits non-virtualized loads as well. If the
scheduler pulls two long-running threads to the same cpu, performance
will take a hit.
--
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.
next parent reply other threads:[~2010-04-10 19:27 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <EB8593BCECAB3D40A8248BE0B6400A3846903F4C@shzsmsx502.ccr.corp.intel.com>
2010-04-10 19:27 ` Avi Kivity [this message]
2010-04-12 2:04 ` VM performance issue in KVM guests Zhang, Xiantao
2010-04-12 6:40 ` Avi Kivity
2010-04-13 0:50 ` Zhang, Xiantao
2010-04-13 6:46 ` Avi Kivity
2010-04-14 3:24 ` Zhang, Xiantao
2010-04-14 8:14 ` Avi Kivity
2010-04-16 2:27 ` Zhang, Xiantao
2010-04-17 19:02 ` Avi Kivity
[not found] ` <p2o2eae271004142158xaa5da968ueff0c2afe6894f9d@mail.gmail.com>
2010-04-15 8:18 ` Avi Kivity
2010-04-15 13:33 ` Peter Zijlstra
2010-04-15 16:43 ` Srivatsa Vaddagiri
2010-04-16 10:40 ` Peter Zijlstra
2010-04-19 1:32 ` Zhang, Xiantao
2010-04-17 19:04 ` Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4BC0D125.9050108@redhat.com \
--to=avi@redhat.com \
--cc=eddie.dong@intel.com \
--cc=efault@gmx.de \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mtosatti@redhat.com \
--cc=peterz@infradead.org \
--cc=xiantao.zhang@intel.com \
--cc=xiaowei.yang@intel.com \
--cc=xin.li@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox