Skip to contentSkip to conversation

mmdrop external module oops

PATCH Applied Andrea Arcangeli 2 participants 2 messages Feb 20, 2008 KVM

lore
Share & tools
lore
#0 lore raw

A 2.6.25-rc based kernel spawned an oops in mmdrop when kvm quit so that reminded me of this:

kernel/external-module-compat.h +5 -0
index 20ef841..fd3cb1d 100644
@@ -564,6 +564,11 @@ static inline void blahblah(void)
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
 
 #define mmdrop(x) do { (void)(x); } while (0)
+#define mmget(x) do { (void)(x); } while (0)
+
+#else
+
+#define mmget(x) do { atomic_inc(x); } while (0)
 
 #endif
 
kernel/hack-module.awk +1 -1
index ad7a7c5..404944e 100644
@@ -33,7 +33,7 @@
     vmx_load_host_state = 0
 }
 
-/atomic_inc\(&kvm->mm->mm_count\);/ { $0 = "//" $0 }
+/atomic_inc\(&kvm->mm->mm_count\);/ { $0 = "mmget(&kvm->mm->mm_count);" }
 
 /^\t\.fault = / {
     fcn = gensub(/,/, "", "g", $3)

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

Applied
#1 lore raw
Quoted 3 lines · Andrea Arcangeli

A 2.6.25-rc based kernel spawned an oops in mmdrop when kvm quit so that reminded me of this:

Applied, thanks.

Signature · 7 lines
Any sufficiently difficult bug is indistinguishable from a feature.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/