提交 7a73c028 编写于 作者: A Avi Kivity

KVM: Use kmalloc() instead of vmalloc() for KVM_[GS]ET_MSR

We don't need more than a page, and vmalloc() is slower (much
slower recently due to a regression).
Signed-off-by: NAvi Kivity <avi@redhat.com>
上级 6aa0b9de
...@@ -1562,7 +1562,7 @@ static int msr_io(struct kvm_vcpu *vcpu, struct kvm_msrs __user *user_msrs, ...@@ -1562,7 +1562,7 @@ static int msr_io(struct kvm_vcpu *vcpu, struct kvm_msrs __user *user_msrs,
r = -ENOMEM; r = -ENOMEM;
size = sizeof(struct kvm_msr_entry) * msrs.nmsrs; size = sizeof(struct kvm_msr_entry) * msrs.nmsrs;
entries = vmalloc(size); entries = kmalloc(size, GFP_KERNEL);
if (!entries) if (!entries)
goto out; goto out;
...@@ -1581,7 +1581,7 @@ static int msr_io(struct kvm_vcpu *vcpu, struct kvm_msrs __user *user_msrs, ...@@ -1581,7 +1581,7 @@ static int msr_io(struct kvm_vcpu *vcpu, struct kvm_msrs __user *user_msrs,
r = n; r = n;
out_free: out_free:
vfree(entries); kfree(entries);
out: out:
return r; return r;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册