Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 04 Aug 1997 20:15:55 -0600
From:      Steve Passe <smp@csn.net>
To:        current@freebsd.org
Subject:   tsleep & KTRACE on SMP
Message-ID:  <199708050215.UAA13712@Ilsa.StevesCafe.com>

next in thread | raw e-mail | index | archive | help
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





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199708050215.UAA13712>