aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/mmu.c
diff options
context:
space:
mode:
authorWei Yongjun <yjwei@cn.fujitsu.com>2010-08-23 04:13:15 -0400
committerAvi Kivity <avi@redhat.com>2010-10-24 04:51:21 -0400
commit45bf21a8ce7a2884f067a702a5c7683684846ce1 (patch)
tree68d4ed52d4125543e741027ab89f8f6f4bce6183 /arch/x86/kvm/mmu.c
parent80b63faf028fba79e630d3643b0e615bddf4067b (diff)
KVM: MMU: fix missing percpu counter destroy
commit ad05c88266b4cce1c820928ce8a0fb7690912ba1 (KVM: create aggregate kvm_total_used_mmu_pages value) introduce percpu counter kvm_total_used_mmu_pages but never destroy it, this may cause oops when rmmod & modprobe. Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com> Acked-by: Tim Pepper <lnxninja@linux.vnet.ibm.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm/mmu.c')
-rw-r--r--arch/x86/kvm/mmu.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index c2ac7004441a..54a50268cebf 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -3185,6 +3185,7 @@ static void mmu_destroy_caches(void)
3185void kvm_mmu_module_exit(void) 3185void kvm_mmu_module_exit(void)
3186{ 3186{
3187 mmu_destroy_caches(); 3187 mmu_destroy_caches();
3188 percpu_counter_destroy(&kvm_total_used_mmu_pages);
3188 unregister_shrinker(&mmu_shrinker); 3189 unregister_shrinker(&mmu_shrinker);
3189} 3190}
3190 3191
@@ -3207,7 +3208,9 @@ int kvm_mmu_module_init(void)
3207 if (!mmu_page_header_cache) 3208 if (!mmu_page_header_cache)
3208 goto nomem; 3209 goto nomem;
3209 3210
3210 percpu_counter_init(&kvm_total_used_mmu_pages, 0); 3211 if (percpu_counter_init(&kvm_total_used_mmu_pages, 0))
3212 goto nomem;
3213
3211 register_shrinker(&mmu_shrinker); 3214 register_shrinker(&mmu_shrinker);
3212 3215
3213 return 0; 3216 return 0;