From 989cf5dc2171c9ce1a0bca7b26296d67bbad896a Mon Sep 17 00:00:00 2001 From: miod Date: Fri, 1 May 2015 11:17:22 +0000 Subject: [PATCH] Do not grab the kernel lock for clock interrupts. Help and ok kettenis@ --- sys/arch/mips64/mips64/clock.c | 6 ++---- sys/arch/octeon/dev/octeon_intr.c | 4 ++-- sys/arch/sgi/sgi/intr_template.c | 6 +++--- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/sys/arch/mips64/mips64/clock.c b/sys/arch/mips64/mips64/clock.c index ceb7fce0ea2..53091b2c02a 100644 --- a/sys/arch/mips64/mips64/clock.c +++ b/sys/arch/mips64/mips64/clock.c @@ -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 } diff --git a/sys/arch/octeon/dev/octeon_intr.c b/sys/arch/octeon/dev/octeon_intr.c index 0da4f6823a0..65f77e719f1 100644 --- a/sys/arch/octeon/dev/octeon_intr.c +++ b/sys/arch/octeon/dev/octeon_intr.c @@ -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); } diff --git a/sys/arch/sgi/sgi/intr_template.c b/sys/arch/sgi/sgi/intr_template.c index 941b5a1ffba..8fea687f635 100644 --- a/sys/arch/sgi/sgi/intr_template.c +++ b/sys/arch/sgi/sgi/intr_template.c @@ -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); } -- 2.20.1