Commit 30644b90 authored by Xiao Guangrong's avatar Xiao Guangrong Committed by Avi Kivity

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: default avatarXiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent eb259186
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
* *
*/ */
#include <linux/ratelimit.h>
static const char *audit_msg; static const char *audit_msg;
typedef void (*inspect_spte_fn) (struct kvm_vcpu *vcpu, u64 *sptep, int level); typedef 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,6 +230,11 @@ static void audit_vcpu_spte(struct kvm_vcpu *vcpu)
static void kvm_mmu_audit(void *ignore, struct kvm_vcpu *vcpu, int audit_point) static void kvm_mmu_audit(void *ignore, struct kvm_vcpu *vcpu, int audit_point)
{ {
static DEFINE_RATELIMIT_STATE(ratelimit_state, 5 * HZ, 10);
if (!__ratelimit(&ratelimit_state))
return;
audit_msg = audit_point_name[audit_point]; audit_msg = audit_point_name[audit_point];
audit_all_active_sps(vcpu->kvm); audit_all_active_sps(vcpu->kvm);
audit_vcpu_spte(vcpu); audit_vcpu_spte(vcpu);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment