Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Aug 1997 23:38:23 +0200
From:      Poul-Henning Kamp <phk@critter.dk.tfs.com>
To:        Steve Passe <smp@csn.net>
Cc:        Poul-Henning Kamp <phk@dk.tfs.com>, smp@freebsd.org
Subject:   Re: bug ? 
Message-ID:  <3867.871594703@critter.dk.tfs.com>
In-Reply-To: Your message of "Thu, 14 Aug 1997 13:44:34 MDT." <199708141944.NAA02468@Ilsa.StevesCafe.com> 

next in thread | previous in thread | raw e-mail | index | archive | help

>First, I haven't spent any time reading this section of code bwfore today,
>so take anything I say as 'probably'.  Second, I once was of the impression
>that the lite2 lockmanager code was well tested, but I now have my doubts
>about that so we need to look at everything in there with some suspicion.

Ohh, sorry, I mistakenly thought that PAUSE was one of your additions.

>What "break" breaks out of obviosly depends on where the macro is used, but
>to use one example, look at:
>
>#define ACQUIRE(lkp, error, extflags, wanted)				\
>	PAUSE(lkp, wanted);						\
>	for (error = 0; wanted; ) {					\
>		(lkp)->lk_waitcount++;					\
>		simple_unlock(&(lkp)->lk_interlock);			\
>		error = tsleep((void *)lkp, (lkp)->lk_prio,		\
>		    (lkp)->lk_wmesg, (lkp)->lk_timo);			\
>		simple_lock(&(lkp)->lk_interlock);			\
>		(lkp)->lk_waitcount--;					\
>		if (error)						\
>			break;						\
>		if ((extflags) & LK_SLEEPFAIL) {			\
>			error = ENOLCK;					\
>			break;						\
>		}							\
>	}
>
>-
>here the 'break' bypasses the code which goes on to sleep on the lock.

Worse, it breaks out of the switch statement down in lockmgr()  :-(

>Right now the kernel panics almost immediately if the lockmanager is 
>turned on in the SMP kernel.

For a good reason I think.

Well, flag that construct, and look into it when you get there, I just 
happened to look at it by accident.

Poul-Henning

--
Poul-Henning Kamp           | phk@FreeBSD.ORG       FreeBSD Core-team.
http://www.freebsd.org/~phk | phk@login.dknet.dk    Private mailbox.
whois: [PHK]                | phk@tfs.com           TRW Financial Systems, Inc.
Power and ignorance is a disgusting cocktail.



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