Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 05 Apr 2015 12:45:00 -0500
From:      Alan Cox <alc@rice.edu>
To:        Gleb Smirnoff <glebius@FreeBSD.org>, David Wolfskill <david@catwhisker.org>, current@freebsd.org
Cc:        alc@FreeBSD.org
Subject:   Re: panic: Lock vm object not exclusively locked @ /usr/src/sys/vm/vm_page.c:2637
Message-ID:  <5521749C.4020408@rice.edu>
In-Reply-To: <20150405154721.GO64665@FreeBSD.org>
References:  <20150405133758.GA40261@albert.catwhisker.org> <20150405154721.GO64665@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 04/05/2015 10:47, Gleb Smirnoff wrote:
> On Sun, Apr 05, 2015 at 06:37:58AM -0700, David Wolfskill wrote:
> D> It ocurred rather late in the transition to multi-user mode, but
> D> prior to starting xdm (on my laptop).
> D>=20
> D> Previous (working) head/i386 for this machine was r281074.
> D>=20
> D> Here's the first bit of the crashinfo (yes, I have a crash dump):
> D>=20
> D> g1-254.catwhisker.org dumped core - see /var/crash/vmcore.3
> D>=20
> D> Sun Apr  5 06:18:44 PDT 2015
> D>=20
> D> FreeBSD g1-254.catwhisker.org 11.0-CURRENT FreeBSD 11.0-CURRENT #156=
1  r281106M/281106:1100067: Sun Apr  5 06:01:06 PDT 2015     root@g1-254.=
catwhisker.org:/common/S4/obj/usr/src/sys/CANARY  i386
> D>=20
> D> panic: Lock vm object not exclusively locked @ /usr/src/sys/vm/vm_pa=
ge.c:2637
>
> This is r281079.
>
> Since vm_page_advise() may call vm_page_dirty() in the MADV_DONTNEED ca=
se,
> the assertion is valid. So, looks like vm_fault_dontneed() needs W-lock=
 on
> the first_object.
>

Actually, what I forgot was that vm_page_advise(MADV_FREE) clears the
page's dirty field, and that is why an exclusive lock is asserted.  As
explained in vm_page.h, the pmap is allowed to set the dirty field to
all ones without any locking.  Moreover, the new "fast" path in
vm_fault() sets the dirty field with only a read lock held.=20
vm_page_advise(MADV_DONTNEED) isn't really any different from the fast pa=
th.

Need to think a bit ...


=20






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