Skip to content

Commit

Permalink
KVM: MMU: lower the aduit frequency
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Xiao Guangrong authored and Avi Kivity committed Oct 24, 2010
1 parent eb25918 commit 30644b9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions arch/x86/kvm/mmu_audit.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
*
*/

#include <linux/ratelimit.h>

static const char *audit_msg;

typedef void (*inspect_spte_fn) (struct kvm_vcpu *vcpu, u64 *sptep, int level);
Expand Down Expand Up @@ -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 DEFINE_RATELIMIT_STATE(ratelimit_state, 5 * HZ, 10);

if (!__ratelimit(&ratelimit_state))
return;

audit_msg = audit_point_name[audit_point];
audit_all_active_sps(vcpu->kvm);
audit_vcpu_spte(vcpu);
Expand Down

0 comments on commit 30644b9

Please sign in to comment.