Do not grab the kernel lock for clock interrupts. Help and ok kettenis@
authormiod <miod@openbsd.org>
Fri, 1 May 2015 11:17:22 +0000 (11:17 +0000)
committermiod <miod@openbsd.org>
Fri, 1 May 2015 11:17:22 +0000 (11:17 +0000)
sys/arch/mips64/mips64/clock.c
sys/arch/octeon/dev/octeon_intr.c
sys/arch/sgi/sgi/intr_template.c

index ceb7fce..53091b2 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: clock.c,v 1.39 2013/06/03 16:55:22 guenther Exp $ */
+/*     $OpenBSD: clock.c,v 1.40 2015/05/01 11:17:22 miod Exp $ */
 
 /*
  * Copyright (c) 2001-2004 Opsycon AB  (www.opsycon.se / www.opsycon.com)
@@ -146,10 +146,9 @@ cp0_int5(uint32_t mask, struct trap_frame *tf)
        if (tf->ipl < IPL_CLOCK) {
 #ifdef MULTIPROCESSOR
                register_t sr;
-               /* Enable interrupts at this (hardware) level again */
+
                sr = getsr();
                ENABLEIPI();
-               __mp_lock(&kernel_lock);
 #endif
                while (ci->ci_pendingticks) {
                        cp0_clock_count.ec_count++;
@@ -157,7 +156,6 @@ cp0_int5(uint32_t mask, struct trap_frame *tf)
                        ci->ci_pendingticks--;
                }
 #ifdef MULTIPROCESSOR
-               __mp_unlock(&kernel_lock);
                setsr(sr);
 #endif
        }
index 0da4f68..65f77e7 100644 (file)
@@ -278,7 +278,7 @@ octeon_iointr(uint32_t hwpend, struct trap_frame *frame)
                                        if (ih->ih_level < IPL_IPI) {
                                                sr = getsr();
                                                ENABLEIPI();
-                                               if (ipl < IPL_SCHED)
+                                               if (ih->ih_level < IPL_CLOCK)
                                                        __mp_lock(&kernel_lock);
                                        }
 #endif
@@ -289,7 +289,7 @@ octeon_iointr(uint32_t hwpend, struct trap_frame *frame)
                                        }
 #ifdef MULTIPROCESSOR
                                        if (ih->ih_level < IPL_IPI) {
-                                               if (ipl < IPL_SCHED)
+                                               if (ih->ih_level < IPL_CLOCK)
                                                        __mp_unlock(&kernel_lock);
                                                setsr(sr);
                                        }
index 941b5a1..8fea687 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: intr_template.c,v 1.14 2014/09/30 06:51:58 jmatthew Exp $     */
+/*     $OpenBSD: intr_template.c,v 1.15 2015/05/01 11:17:22 miod Exp $ */
 
 /*
  * Copyright (c) 2009 Miodrag Vallat.
@@ -163,7 +163,7 @@ INTR_FUNCTIONNAME(uint32_t hwpend, struct trap_frame *frame)
                                        if (ih->ih_level < IPL_IPI) {
                                                sr = getsr();
                                                ENABLEIPI();
-                                               if (ipl < IPL_SCHED)
+                                               if (ih->ih_level < IPL_CLOCK)
                                                        __mp_lock(&kernel_lock);
                                        }
 #endif
@@ -175,7 +175,7 @@ INTR_FUNCTIONNAME(uint32_t hwpend, struct trap_frame *frame)
                                        }
 #ifdef MULTIPROCESSOR
                                        if (ih->ih_level < IPL_IPI) {
-                                               if (ipl < IPL_SCHED)
+                                               if (ih->ih_level < IPL_CLOCK)
                                                        __mp_unlock(&kernel_lock);
                                                setsr(sr);
                                        }