From: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
To: Paolo Bonzini <pbonzini@redhat.com>, <rkrcmar@redhat.com>,
<joro@8bytes.org>, <bp@alien8.de>, <gleb@kernel.org>,
<alex.williamson@redhat.com>
Cc: <kvm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<wei@redhat.com>, <sherry.hurwitz@amd.com>
Subject: Re: [PART1 RFC v2 05/10] KVM: x86: Detect and Initialize AVIC support
Date: Wed, 16 Mar 2016 13:22:03 +0700 [thread overview]
Message-ID: <56E8FB8B.7050700@amd.com> (raw)
In-Reply-To: <56E844E2.6090507@redhat.com>
Hi,
On 03/16/2016 12:22 AM, Paolo Bonzini wrote:
>>> Why is this necessary? The APIC access page is a peculiarity of Intel
>>> >>processors (and the special memslot for only needs to map 0xfee00000 to
>>> >>0xfee00fff; after that there is the MSI area).
>> >
>> >The current lapic regs page is allocated using get_zeroed_page(), which
>> >can be paged out. If I use these pages for AVIC backing pages, it seems
>> >to cause VM to slow down quite a bit due to a lot of page faults.
> What causes the lapic regs page to be paged out?
>
This is mainly causing a large number of VMEXIT due to NPF. In my test
running hackbench in the guest. The following are perf result profiling
for 10 seconds in the host in two cases:
CASE1: Using x86_set_memory_region() for AVIC backing page
# ./perf-vmexit.sh 10
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 2.813 MB perf.data.guest (30356 samples) ]
Analyze events for all VMs, all VCPUs:
VM-EXIT Samples Samples% Time% Min Time Max
Time Avg time
interrupt 10042 66.30% 81.33% 0.43us
202.50us 7.43us ( +- 1.20% )
msr 5004 33.04% 15.76% 0.73us
12.21us 2.89us ( +- 0.43% )
pause 58 0.38% 0.18% 0.56us
5.88us 2.92us ( +- 6.43% )
npf 35 0.23% 2.01% 6.41us
207.78us 52.70us ( +- 23.67% )
nmi 4 0.03% 0.02% 2.31us
4.67us 3.49us ( +- 14.26% )
io 3 0.02% 0.70% 82.75us
360.90us 214.28us ( +- 37.64% )
avic_incomp_ipi 1 0.01% 0.00% 2.17us
2.17us 2.17us ( +- 0.00% )
Total Samples:15147, Total events handled time:91715.78us.
CASE2: Using the lapic regs page for AVIC backing page.
# ./perf-vmexit.sh 10
[ perf record: Woken up 255 times to write data ]
[ perf record: Captured and wrote 509.202 MB perf.data.guest (5718856
samples) ]
Analyze events for all VMs, all VCPUs:
VM-EXIT Samples Samples% Time% Min Time Max
Time Avg time
npf 1897710 99.33% 98.08% 1.09us
243.22us 1.67us ( +- 0.04% )
interrupt 7818 0.41% 1.44% 0.44us
216.55us 5.97us ( +- 1.92% )
msr 5001 0.26% 0.45% 0.68us
12.58us 2.89us ( +- 0.50% )
pause 25 0.00% 0.00% 0.71us
4.23us 2.03us ( +- 10.76% )
io 4 0.00% 0.03% 73.91us
337.29us 206.74us ( +- 26.38% )
nmi 1 0.00% 0.00% 5.92us
5.92us 5.92us ( +- 0.00% )
Total Samples:1910559, Total events handled time:3229214.64us.
Thanks,
Suravee
next prev parent reply other threads:[~2016-03-16 6:22 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-04 20:45 [PART1 RFC v2 00/10] KVM: x86: Introduce SVM AVIC support Suravee Suthikulpanit
2016-03-04 20:45 ` [PART1 RFC v2 01/10] KVM: x86: Misc LAPIC changes to exposes helper functions Suravee Suthikulpanit
2016-03-04 20:46 ` [PART1 RFC v2 02/10] KVM: x86: Introducing kvm_x86_ops VCPU blocking/unblocking Suravee Suthikulpanit
2016-03-07 15:42 ` Paolo Bonzini
2016-03-14 6:19 ` Suravee Suthikulpanit
2016-03-04 20:46 ` [PART1 RFC v2 03/10] svm: Introduce new AVIC VMCB registers Suravee Suthikulpanit
2016-03-07 15:44 ` Paolo Bonzini
2016-03-14 7:41 ` Suravee Suthikulpanit
2016-03-14 12:25 ` Paolo Bonzini
2016-03-15 12:51 ` Suravee Suthikulpanit
2016-03-04 20:46 ` [PART1 RFC v2 04/10] svm: clean up V_TPR, V_IRQ, V_INTR_PRIO, and V_INTR_MASKING Suravee Suthikulpanit
2016-03-04 20:46 ` [PART1 RFC v2 05/10] KVM: x86: Detect and Initialize AVIC support Suravee Suthikulpanit
2016-03-07 16:41 ` Paolo Bonzini
2016-03-15 17:09 ` Suravee Suthikulpanit
2016-03-15 17:22 ` Paolo Bonzini
2016-03-16 6:22 ` Suravee Suthikulpanit [this message]
2016-03-16 7:20 ` Paolo Bonzini
2016-03-16 8:21 ` Suravee Suthikulpanit
2016-03-16 11:12 ` Paolo Bonzini
2016-03-04 20:46 ` [PART1 RFC v2 06/10] svm: Add interrupt injection via AVIC Suravee Suthikulpanit
2016-03-07 15:36 ` Paolo Bonzini
2016-03-08 21:54 ` Radim Krčmář
2016-03-09 11:10 ` Paolo Bonzini
2016-03-09 16:00 ` Radim Krčmář
2016-03-14 9:41 ` Suravee Suthikulpanit
2016-03-14 12:27 ` Paolo Bonzini
2016-03-14 9:50 ` Suravee Suthikulpanit
2016-03-14 5:25 ` Suravee Suthikulpanit
2016-03-14 8:54 ` Suravee Suthikulpanit
2016-03-04 20:46 ` [PART1 RFC v2 07/10] svm: Add VMEXIT handlers for AVIC Suravee Suthikulpanit
2016-03-07 15:58 ` Paolo Bonzini
2016-03-08 22:05 ` Radim Krčmář
2016-03-09 10:56 ` Paolo Bonzini
2016-03-09 20:55 ` Radim Krčmář
2016-03-10 19:34 ` Radim Krčmář
2016-03-10 19:54 ` Paolo Bonzini
2016-03-10 20:44 ` Radim Krčmář
2016-03-17 3:58 ` Suravee Suthikulpanit
2016-03-17 9:35 ` Paolo Bonzini
2016-03-17 19:44 ` Suravee Suthikulpanit
2016-03-17 20:27 ` [PATCH] KVM: split kvm_vcpu_wake_up from kvm_vcpu_kick Radim Krčmář
2016-03-18 5:13 ` Suravee Suthikulpanit
2016-03-04 20:46 ` [PART1 RFC v2 08/10] svm: Do not expose x2APIC when enable AVIC Suravee Suthikulpanit
2016-03-04 20:46 ` [PART1 RFC v2 09/10] svm: Do not intercept CR8 " Suravee Suthikulpanit
2016-03-07 15:39 ` Paolo Bonzini
2016-03-14 6:09 ` Suravee Suthikulpanit
2016-03-14 12:28 ` Paolo Bonzini
2016-03-04 20:46 ` [PART1 RFC v2 10/10] svm: Manage vcpu load/unload " Suravee Suthikulpanit
2016-03-09 21:46 ` Radim Krčmář
2016-03-10 14:01 ` Radim Krčmář
2016-03-14 11:58 ` Suravee Suthikulpanit
2016-03-14 16:54 ` Radim Krčmář
2016-03-14 11:48 ` Suravee Suthikulpanit
2016-03-14 16:40 ` Radim Krčmář
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=56E8FB8B.7050700@amd.com \
--to=suravee.suthikulpanit@amd.com \
--cc=alex.williamson@redhat.com \
--cc=bp@alien8.de \
--cc=gleb@kernel.org \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=rkrcmar@redhat.com \
--cc=sherry.hurwitz@amd.com \
--cc=wei@redhat.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;
as well as URLs for NNTP newsgroup(s).