From owner-freebsd-current Mon Aug 4 19:16:20 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id TAA12817 for current-outgoing; Mon, 4 Aug 1997 19:16:20 -0700 (PDT) Received: from Ilsa.StevesCafe.com (Ilsa.StevesCafe.com [205.168.119.129]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id TAA12811 for ; Mon, 4 Aug 1997 19:16:10 -0700 (PDT) Received: from Ilsa.StevesCafe.com (localhost [127.0.0.1]) by Ilsa.StevesCafe.com (8.8.6/8.8.5) with ESMTP id UAA13712 for ; Mon, 4 Aug 1997 20:15:55 -0600 (MDT) Message-Id: <199708050215.UAA13712@Ilsa.StevesCafe.com> X-Mailer: exmh version 2.0gamma 1/27/96 From: Steve Passe To: current@freebsd.org Subject: tsleep & KTRACE on SMP Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 04 Aug 1997 20:15:55 -0600 Sender: owner-freebsd-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Hi, I am debugging PR kern/3835 and find that the problem is in tsleep(). Specifically if the config file contains: config dumps on wd0 the code to set this up happens in configure() b4 curproc (ie *p) is setup. configure() maintains the variable 'cold' to deal with this issue. However when KTRACE is enabled the code in tsleep attempts to use curproc before testing 'cold': ----------------------------------- cut ----------------------------------- tsleep(ident, priority, wmesg, timo) { ... #ifdef KTRACE if (KTRPOINT(p, KTR_CSW)) ktrcsw(p->p_tracep, 1, 0); #endif s = splhigh(); if (cold || panicstr) { /* * After a panic, or during autoconfiguration, * just give interrupts a chance, then just return; * don't run any other procs or panic below, * in case this is the idle process and already asleep. */ splx(safepri); splx(s); return (0); } #ifdef DIAGNOSTIC ----------------------------------- cut ----------------------------------- if I move the "ifdef KTRACE" section to after the "if (cold ..." test the SMP kernel is happy. Does anyone see why this would be a bad thing to do in the general (ie UP) case? Or should I conditionalize the location of the KTRACE code with "ifdef SMP"? -- Steve Passe | powered by smp@csn.net | Symmetric MultiProcessor FreeBSD