From owner-p4-projects@FreeBSD.ORG Thu May 8 06:53:13 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4FC2637B405; Thu, 8 May 2003 06:53:13 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DC32337B401 for ; Thu, 8 May 2003 06:53:12 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 367FD43FA3 for ; Thu, 8 May 2003 06:53:12 -0700 (PDT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h48DrC0U046868 for ; Thu, 8 May 2003 06:53:12 -0700 (PDT) (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h48DrBi3046865 for perforce@freebsd.org; Thu, 8 May 2003 06:53:11 -0700 (PDT) Date: Thu, 8 May 2003 06:53:11 -0700 (PDT) Message-Id: <200305081353.h48DrBi3046865@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Subject: PERFORCE change 30802 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2003 13:53:14 -0000 http://perforce.freebsd.org/chv.cgi?CH=30802 Change 30802 by jhb@jhb_laptop on 2003/05/08 06:53:01 Use td_critnest instead of the spinlocks list since the spinlocks list is only used if WITNESS is enabled. Affected files ... .. //depot/projects/smpng/sys/i386/i386/trap.c#56 edit Differences ... ==== //depot/projects/smpng/sys/i386/i386/trap.c#56 (text+ko) ==== @@ -222,10 +222,10 @@ type); /* * Page faults need interrupts diasabled until later, - * and we shouldn't enable interrupts while holding a - * spin lock. + * and we shouldn't enable interrupts while in a + * critical section. */ - if (type != T_PAGEFLT && PCPU_GET(spinlocks) == NULL) + if (type != T_PAGEFLT && td->td_critnest == 0) enable_intr(); } } @@ -240,7 +240,7 @@ * are finally ready to read %cr2 and then must * reenable interrupts. * - * If we get a page fault while holding a spin lock, then + * If we get a page fault while in a critical section, then * it is most likely a fatal kernel page fault. The kernel * is already going to panic trying to get a sleep lock to * do the VM lookup, so just consider it a fatal trap so the @@ -248,7 +248,7 @@ * to the debugger. */ eva = rcr2(); - if (PCPU_GET(spinlocks) == NULL) + if (td->td_critnest == 0) enable_intr(); else trap_fatal(&frame, eva);