From owner-freebsd-current@FreeBSD.ORG Mon Jul 19 13:57:31 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B853116A4CE for ; Mon, 19 Jul 2004 13:57:31 +0000 (GMT) Received: from mail5.speakeasy.net (mail5.speakeasy.net [216.254.0.205]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8C52B43D54 for ; Mon, 19 Jul 2004 13:57:31 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: (qmail 21671 invoked from network); 19 Jul 2004 13:57:31 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 19 Jul 2004 13:57:30 -0000 Received: from slimer.baldwin.cx (slimer.baldwin.cx [192.168.0.16]) (authenticated bits=0) by server.baldwin.cx (8.12.11/8.12.11) with ESMTP id i6JDv582012229; Mon, 19 Jul 2004 09:57:27 -0400 (EDT) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: Bosko Milekic Date: Mon, 19 Jul 2004 09:57:30 -0400 User-Agent: KMail/1.6 References: <20040717193351.GA83772@freefall.freebsd.org> In-Reply-To: <20040717193351.GA83772@freefall.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200407190957.30459.jhb@FreeBSD.org> X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on server.baldwin.cx cc: Brian Fundakowski Feldman cc: current@FreeBSD.org cc: "M. Warner Losh" Subject: Re: pccbb crashes when detaching (unsafe interrupt handler) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2004 13:57:31 -0000 On Saturday 17 July 2004 03:33 pm, Bosko Milekic wrote: > Brian Feldman wrote: > >>From currentish kern_intr.c: > > > > if ((ih->ih_flags & IH_DEAD) != 0) { > > mtx_lock(&ithd->it_lock); > > TAILQ_REMOVE(&ithd->it_handlers, ih, > > ih_next); > > wakeup(ih); > > mtx_unlock(&ithd->it_lock); > > goto restart; > > } > >We add a flag IH_PIN: > > if ((ih->ih_flags & (IH_DEAD | IH_PIN)) != 0) { > > if ((ih->ih_flags & IH_DEAD) == 0) { > > wakeup(ih); > > continue; > > } > > mtx_lock(&ithd->it_lock); > > TAILQ_REMOVE(&ithd->it_handlers, > > ih, ih_next); > > wakeup(ih); > > mtx_unlock(&ithd->it_lock); > > goto restart; > > } > > Neither -current nor your version should be holding the ithd lock > across the wakeup(). Yes, in general there are (low-priority) changes to reduce the assertions for cv and sleep wakeups to not assert that the condition protecting lock is held and to change code like this to not hold the lock across the wakeup. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org