Skip to content

Commit

Permalink
KVM: Use kmalloc() instead of vmalloc() for KVM_[GS]ET_MSR
Browse files Browse the repository at this point in the history
We don't need more than a page, and vmalloc() is slower (much
slower recently due to a regression).

Signed-off-by: Avi Kivity <avi@redhat.com>
  • Loading branch information
Avi Kivity committed Jul 23, 2010
1 parent 6aa0b9d commit 7a73c02
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/x86/kvm/x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -1562,7 +1562,7 @@ static int msr_io(struct kvm_vcpu *vcpu, struct kvm_msrs __user *user_msrs,

r = -ENOMEM;
size = sizeof(struct kvm_msr_entry) * msrs.nmsrs;
entries = vmalloc(size);
entries = kmalloc(size, GFP_KERNEL);
if (!entries)
goto out;

Expand All @@ -1581,7 +1581,7 @@ static int msr_io(struct kvm_vcpu *vcpu, struct kvm_msrs __user *user_msrs,
r = n;

out_free:
vfree(entries);
kfree(entries);
out:
return r;
}
Expand Down

0 comments on commit 7a73c02

Please sign in to comment.