aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXiao Guangrong <xiaoguangrong@cn.fujitsu.com>2010-08-30 06:26:33 -0400
committerAvi Kivity <avi@redhat.com>2010-10-24 04:51:59 -0400
commit30644b902c5eef5328d37a2e15f1921aaca2588b (patch)
treee8b00712784cfa6a3f4787443ba3a75eebbefb19
parenteb2591865a234c6fb1162085d9b277236fa890b6 (diff)
KVM: MMU: lower the aduit frequency
The audit is very high overhead, so we need lower the frequency to assure the guest is running. Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> Signed-off-by: Avi Kivity <avi@redhat.com>
-rw-r--r--arch/x86/kvm/mmu_audit.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/x86/kvm/mmu_audit.c b/arch/x86/kvm/mmu_audit.c
index 3bde186409bf..bd2b1be7066e 100644
--- a/arch/x86/kvm/mmu_audit.c
+++ b/arch/x86/kvm/mmu_audit.c
@@ -17,6 +17,8 @@
17 * 17 *
18 */ 18 */
19 19
20#include <linux/ratelimit.h>
21
20static const char *audit_msg; 22static const char *audit_msg;
21 23
22typedef void (*inspect_spte_fn) (struct kvm_vcpu *vcpu, u64 *sptep, int level); 24typedef void (*inspect_spte_fn) (struct kvm_vcpu *vcpu, u64 *sptep, int level);
@@ -228,6 +230,11 @@ static void audit_vcpu_spte(struct kvm_vcpu *vcpu)
228 230
229static void kvm_mmu_audit(void *ignore, struct kvm_vcpu *vcpu, int audit_point) 231static void kvm_mmu_audit(void *ignore, struct kvm_vcpu *vcpu, int audit_point)
230{ 232{
233 static DEFINE_RATELIMIT_STATE(ratelimit_state, 5 * HZ, 10);
234
235 if (!__ratelimit(&ratelimit_state))
236 return;
237
231 audit_msg = audit_point_name[audit_point]; 238 audit_msg = audit_point_name[audit_point];
232 audit_all_active_sps(vcpu->kvm); 239 audit_all_active_sps(vcpu->kvm);
233 audit_vcpu_spte(vcpu); 240 audit_vcpu_spte(vcpu);