Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Nov 2001 09:16:26 -0800 (PST)
From:      David Wolfskill <david@catwhisker.org>
To:        current@freebsd.org
Subject:   lock order reversal for today's -CURRENT
Message-ID:  <200111141716.fAEHGQG33323@bunrab.catwhisker.org>

next in thread | raw e-mail | index | archive | help
Built & booted today's -CURRENT; saw the following on the console & in
/var/log/messages:

Nov 14 08:59:25 localhost /boot/kernel/kernel: lock order reversal
Nov 14 08:59:25 localhost /boot/kernel/kernel: 1st 0xc0427980 dev_pager create @ /usr/src/sys/vm/device_pager.c:143
Nov 14 08:59:25 localhost /boot/kernel/kernel: 2nd 0xc03feca0 pool mutex @ /usr/src/sys/kern/kern_sx.c:329


For device_pager.c (in dev_pager_alloc()):

        /*
         * Lock to prevent object creation race condition.
         */
        sx_xlock(&dev_pager_sx);

        /*
         * Look up pager, creating as necessary.
         */
        object = vm_pager_object_lookup(&dev_pager_object_list, handle);

For kern_sx.c (in _sx_assert()):

        switch (what) {
        case SX_LOCKED:
        case SX_SLOCKED:
...
        case SX_XLOCKED:
                mtx_lock(sx->sx_lock);
                if (sx->sx_xholder != curthread)
                        printf("Lock %s not exclusively locked @ %s:%d",
                            sx->sx_object.lo_name, file, line);
                mtx_unlock(sx->sx_lock);
                break;
        default:

It's the SX_XLOCKED case that's of interest.

Sorry, I'm not clueful enough to do much with the code beyond this
"pointing & grunting".  But I'm willing to test....

Running
FreeBSD m147.whistle.com 5.0-CURRENT FreeBSD 5.0-CURRENT #172: Wed Nov 14 08:37:20 PST 2001     root@localhost:/common/S3/obj/usr/src/sys/LAPTOP_30W  i386


Recent CVSup history:
freebeast[1] tail /var/log/cvsup-history.log
CVSup begin from cvsup14.freebsd.org at Sat Nov 10 03:47:00 PST 2001
CVSup ended from cvsup14.freebsd.org at Sat Nov 10 03:54:07 PST 2001
CVSup begin from cvsup14.freebsd.org at Sun Nov 11 03:47:00 PST 2001
CVSup ended from cvsup14.freebsd.org at Sun Nov 11 03:52:55 PST 2001
CVSup begin from cvsup14.freebsd.org at Mon Nov 12 03:47:00 PST 2001
CVSup ended from cvsup14.freebsd.org at Mon Nov 12 03:52:53 PST 2001
CVSup begin from cvsup14.freebsd.org at Tue Nov 13 03:47:00 PST 2001
CVSup ended from cvsup14.freebsd.org at Tue Nov 13 03:53:11 PST 2001
CVSup begin from cvsup14.freebsd.org at Wed Nov 14 03:47:00 PST 2001
CVSup ended from cvsup14.freebsd.org at Wed Nov 14 03:53:08 PST 2001

(I haven't built much on freebeast today; tried tinkering with BIOS
options & made the machine unstable enough that it crashed during the
-STABLE buildworld twice this morning.  I need to wait 'til I can
borrow my spouse's PC monitor to undo that damage.  Meanwhile, what I
report above is happening on the laptop.)

Cheers,
david
-- 
David H. Wolfskill				david@catwhisker.org
As a computing professional, I believe it would be unethical for me to
advise, recommend, or support the use (save possibly for personal
amusement) of any product that is or depends on any Microsoft product.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




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