Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Feb 2012 23:14:52 +0900 (JST)
From:      Hiroki Sato <hrs@FreeBSD.org>
To:        rmacklem@uoguelph.ca
Cc:        kostikbel@gmail.com, stable@FreeBSD.org, jhb@FreeBSD.org
Subject:   Re: panic in 8.3-PRERELEASE
Message-ID:  <20120223.231452.2197780863243078154.hrs@allbsd.org>
In-Reply-To: <476361430.1773817.1329954835308.JavaMail.root@erie.cs.uoguelph.ca>
References:  <201202221633.02170.jhb@freebsd.org> <476361430.1773817.1329954835308.JavaMail.root@erie.cs.uoguelph.ca>

next in thread | previous in thread | raw e-mail | index | archive | help
----Security_Multipart(Thu_Feb_23_23_14_52_2012_010)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Rick Macklem <rmacklem@uoguelph.ca> wrote
  in <476361430.1773817.1329954835308.JavaMail.root@erie.cs.uoguelph.ca>:

rm> John Baldwin wrote:
rm> > On Wednesday, February 22, 2012 2:24:14 pm Konstantin Belousov wrote:
rm> > > On Wed, Feb 22, 2012 at 11:29:40AM -0500, Rick Macklem wrote:
rm> > > > Hiroki Sato wrote:
rm> > > > > Hi,
rm> > > > >
rm> > > > > Just a report, but I got the following panic on an NFS server
rm> > > > > running
rm> > > > > 8.3-PRERELEASE:
rm> > > > >
rm> > > > > ----(from here)----
rm> > > > > pool.allbsd.org dumped core - see /var/crash/vmcore.0
rm> > > > >
rm> > > > > Tue Feb 21 10:59:44 JST 2012
rm> > > > >
rm> > > > > FreeBSD pool.allbsd.org 8.3-PRERELEASE FreeBSD 8.3-PRERELEASE
rm> > > > > #7: Thu
rm> > > > > Feb 16 19:29:19 JST 2012
rm> > > > > hrs@pool.allbsd.org:/usr/obj/usr/src/sys/POOL
rm> > > > > amd64
rm> > > > >
rm> > > > > panic: Assertion lock == sq->sq_lock failed at
rm> > > > > /usr/src/sys/kern/subr_sleepqueue.c:335
rm> > > > >
rm> > > > Oops, I didn't know that mixing msleep() and tsleep() calls on the
rm> > > > same
rm> > > > event wasn't allowed.
rm> > > > There are two places in the code where it did a:
rm> > > >   mtx_unlock();
rm> > > >   tsleep();
rm> > > > left over from the days when it was written for OpenBSD.
rm> > > This sequence allows to lost the wakeup which is happen right after
rm> > > cache unlock (together with clearing the RC_WANTED flag) but before
rm> > > the thread enters sleep state. The tsleep has a timeout so thread
rm> > > should
rm> > > recover in 10 seconds, but still.
rm> > >
rm> > > Anyway, you should use consistent outer lock for the same wchan,
rm> > > i.e.
rm> > > no lock (tsleep) or mtx (msleep), but not mix them.
rm> >
rm> > Correct.
rm> >
rm> > > > I don't think the mix would actually break anything, except that
rm> > > > the
rm> > > > MPASS() assertion fails, but I've cc'd jhb@ since he seems to have
rm> > > > been
rm> > > > the author of the sleep() stuff.
rm> > > >
rm> > > > Anyhow, please try the attached patch which replaces the
rm> > > > mtx_unlock();
rm> > tsleep(); with
rm> > > > msleep()s using PDROP. If the attachment gets lost, the patch is
rm> > > > also
rm> > here:
rm> > > >   http://people.freebsd.org/~rmacklem/tsleep.patch
rm> > > >
rm> > > > Thanks for reporting this, rick
rm> > > > ps: Is mtx_lock() now preferred over msleep()?
rm> > > What do you mean ?
rm> >
rm> > mtx_sleep() is preferred over msleep(), but I doubt I will remove
rm> > msleep()
rm> > anytime soon.
rm> >
rm> Ok, I'll redo the patch with mtx_sleep() and get one of you guys to
rm> review it.

 Thank you for the patch!  I applied it and put the box under a stress
 testing again.

-- Hiroki

----Security_Multipart(Thu_Feb_23_23_14_52_2012_010)--
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (FreeBSD)

iEYEABECAAYFAk9GSdwACgkQTyzT2CeTzy3WywCglyyNDeby0X3s1i551DJfB0Nj
yjoAn2OzyCU3KdCK1b2ra/88RHXfhem2
=dUUz
-----END PGP SIGNATURE-----

----Security_Multipart(Thu_Feb_23_23_14_52_2012_010)----



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