* [PATCH] KVM: MMU: fix missing percpu counter destroy
@ 2010-08-23 8:13 Wei Yongjun
2010-08-24 16:22 ` Tim Pepper
2010-08-24 21:26 ` Marcelo Tosatti
0 siblings, 2 replies; 3+ messages in thread
From: Wei Yongjun @ 2010-08-23 8:13 UTC (permalink / raw)
To: Avi Kivity; +Cc: Dave Hansen, Tim Pepper, kvm
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>
---
arch/x86/kvm/mmu.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index f52a965..ef485db 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -3190,6 +3190,7 @@ static void mmu_destroy_caches(void)
void kvm_mmu_module_exit(void)
{
mmu_destroy_caches();
+ percpu_counter_destroy(&kvm_total_used_mmu_pages);
unregister_shrinker(&mmu_shrinker);
}
@@ -3212,7 +3213,9 @@ int kvm_mmu_module_init(void)
if (!mmu_page_header_cache)
goto nomem;
- percpu_counter_init(&kvm_total_used_mmu_pages, 0);
+ if (percpu_counter_init(&kvm_total_used_mmu_pages, 0))
+ goto nomem;
+
register_shrinker(&mmu_shrinker);
return 0;
--
1.7.0.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] KVM: MMU: fix missing percpu counter destroy
2010-08-23 8:13 [PATCH] KVM: MMU: fix missing percpu counter destroy Wei Yongjun
@ 2010-08-24 16:22 ` Tim Pepper
2010-08-24 21:26 ` Marcelo Tosatti
1 sibling, 0 replies; 3+ messages in thread
From: Tim Pepper @ 2010-08-24 16:22 UTC (permalink / raw)
To: Wei Yongjun; +Cc: Avi Kivity, Dave Hansen, Tim Pepper, kvm
On Mon 23 Aug at 16:13:15 +0800 yjwei@cn.fujitsu.com said:
> 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>
--
Tim Pepper <lnxninja@linux.vnet.ibm.com>
IBM Linux Technology Center
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] KVM: MMU: fix missing percpu counter destroy
2010-08-23 8:13 [PATCH] KVM: MMU: fix missing percpu counter destroy Wei Yongjun
2010-08-24 16:22 ` Tim Pepper
@ 2010-08-24 21:26 ` Marcelo Tosatti
1 sibling, 0 replies; 3+ messages in thread
From: Marcelo Tosatti @ 2010-08-24 21:26 UTC (permalink / raw)
To: Wei Yongjun; +Cc: Avi Kivity, Dave Hansen, Tim Pepper, kvm
On Mon, Aug 23, 2010 at 04:13:15PM +0800, Wei Yongjun wrote:
> 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>
> ---
> arch/x86/kvm/mmu.c | 5 ++++-
> 1 files changed, 4 insertions(+), 1 deletions(-)
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-08-25 3:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-23 8:13 [PATCH] KVM: MMU: fix missing percpu counter destroy Wei Yongjun
2010-08-24 16:22 ` Tim Pepper
2010-08-24 21:26 ` Marcelo Tosatti
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).