From mark.kettenis@xs4all.nl Tue Apr 28 23:07:04 2015 Delivered-To: david@gwynne.id.au Received: by 10.194.71.146 with SMTP id v18csp1928100wju; Tue, 28 Apr 2015 06:07:05 -0700 (PDT) X-Received: by 10.68.139.103 with SMTP id qx7mr31935797pbb.133.1430226425088; Tue, 28 Apr 2015 06:07:05 -0700 (PDT) Return-Path: Received: from cvs.openbsd.org (cvs.openbsd.org. [199.185.137.3]) by mx.google.com with ESMTPS id fy2si1623881pbb.129.2015.04.28.06.07.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Apr 2015 06:07:04 -0700 (PDT) Received-SPF: none (google.com: mark.kettenis@xs4all.nl does not designate permitted sender hosts) client-ip=199.185.137.3; Authentication-Results: mx.google.com; spf=none (google.com: mark.kettenis@xs4all.nl does not designate permitted sender hosts) smtp.mail=mark.kettenis@xs4all.nl Received: from shear.ucar.edu (lists.openbsd.org [192.43.244.163]) by cvs.openbsd.org (OpenSMTPD) with ESMTPS id 58b38c31 TLS version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL; Tue, 28 Apr 2015 07:07:03 -0600 (MDT) Received: from glazunov.sibelius.xs4all.nl (sibelius.xs4all.nl [83.163.83.176]) by shear.ucar.edu (8.14.7/8.14.7) with ESMTP id t3SD6xKW006293 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 28 Apr 2015 07:07:01 -0600 (MDT) Received: from glazunov.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3) with ESMTP id t3SD6xlZ014740; Tue, 28 Apr 2015 15:06:59 +0200 (CEST) Received: (from kettenis@localhost) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3/Submit) id t3SD6wlC009497; Tue, 28 Apr 2015 15:06:59 +0200 (CEST) Date: Tue, 28 Apr 2015 15:06:59 +0200 (CEST) Message-Id: <201504281306.t3SD6wlC009497@glazunov.sibelius.xs4all.nl> From: Mark Kettenis To: dlg@openbsd.org, jsing@openbsd.org CC: miod@openbsd.org, deraadt@openbsd.org Subject: hppa biglock in interrupts Status: RO Content-Length: 1351 Lines: 42 So hppa is one of our "challenged" MP architectures. It runs hardclock with the kernel lock, which is incompatible with how we're using mutexes in kernel threads that run without holding the kernel lock. I don't quite understand why we currently have the "&& s < IPL_SCHED" check, but it doesn't make a lot of sense to me. So this changes things such that we check the priority of the handler and simply skip grabbing the kernel lock if the priority of the handler is IPL_CLOCK or higher. There shouldn't be any handlers at IPL_HIGH, IPL_SCHED or IPL_STATCLOCK, so that should work out fine. Can't test this myself, but dlg@ has offered to try this. ok if that works out? Index: intr.c =================================================================== RCS file: /cvs/src/sys/arch/hppa/hppa/intr.c,v retrieving revision 1.46 diff -u -p -r1.46 intr.c --- intr.c 11 Feb 2015 01:55:40 -0000 1.46 +++ intr.c 28 Apr 2015 12:59:05 -0000 @@ -274,7 +274,7 @@ cpu_intr(void *v) mtctl(frame->tf_eiem, CR_EIEM); #ifdef MULTIPROCESSOR - if (pri < IPL_IPI && s < IPL_SCHED) + if (iv->pri < IPL_CLOCK) __mp_lock(&kernel_lock); #endif @@ -296,7 +296,7 @@ cpu_intr(void *v) #endif #ifdef MULTIPROCESSOR - if (pri < IPL_IPI && s < IPL_SCHED) + if (iv->pri < IPL_CLOCK) __mp_unlock(&kernel_lock); #endif mtctl(0, CR_EIEM);