Re: panic: Lock vm object not exclusively locked _at_ /usr/src/sys/vm/vm_page.c:2637

From: Gleb Smirnoff <glebius_at_FreeBSD.org>
Date: Sun, 5 Apr 2015 23:17:44 +0300
On Sun, Apr 05, 2015 at 03:07:56PM -0500, Alan Cox wrote:
A> On 04/05/2015 14:34, Gleb Smirnoff wrote:
A> > On Sun, Apr 05, 2015 at 12:45:00PM -0500, Alan Cox wrote:
A> > A> On 04/05/2015 10:47, Gleb Smirnoff wrote:
A> > A> > On Sun, Apr 05, 2015 at 06:37:58AM -0700, David Wolfskill wrote:
A> > A> > D> It ocurred rather late in the transition to multi-user mode, but
A> > A> > D> prior to starting xdm (on my laptop).
A> > A> > D> 
A> > A> > D> Previous (working) head/i386 for this machine was r281074.
A> > A> > D> 
A> > A> > D> Here's the first bit of the crashinfo (yes, I have a crash dump):
A> > A> > D> 
A> > A> > D> g1-254.catwhisker.org dumped core - see /var/crash/vmcore.3
A> > A> > D> 
A> > A> > D> Sun Apr  5 06:18:44 PDT 2015
A> > A> > D> 
A> > A> > D> FreeBSD g1-254.catwhisker.org 11.0-CURRENT FreeBSD 11.0-CURRENT #1561  r281106M/281106:1100067: Sun Apr  5 06:01:06 PDT 2015     root_at_g1-254.catwhisker.org:/common/S4/obj/usr/src/sys/CANARY  i386
A> > A> > D> 
A> > A> > D> panic: Lock vm object not exclusively locked _at_ /usr/src/sys/vm/vm_page.c:2637
A> > A> >
A> > A> > This is r281079.
A> > A> >
A> > A> > Since vm_page_advise() may call vm_page_dirty() in the MADV_DONTNEED case,
A> > A> > the assertion is valid. So, looks like vm_fault_dontneed() needs W-lock on
A> > A> > the first_object.
A> > A> >
A> > A> 
A> > A> Actually, what I forgot was that vm_page_advise(MADV_FREE) clears the
A> > A> page's dirty field, and that is why an exclusive lock is asserted.  As
A> > A> explained in vm_page.h, the pmap is allowed to set the dirty field to
A> > A> all ones without any locking.  Moreover, the new "fast" path in
A> > A> vm_fault() sets the dirty field with only a read lock held. 
A> > A> vm_page_advise(MADV_DONTNEED) isn't really any different from the fast path.
A> > A> 
A> > A> Need to think a bit ...
A> >
A> > Can you please plug the panic somehow interim? For me the assert fires 100%
A> > reliably on any build attempt. Right now I changed vm_fault_dontneed() to
A> > take W-lock, so that I can continue running head. Not sure this is correct
A> > measure.
A> >
A> 
A> Just curious, amd64 or i386?

Panics on amd64...., while building a kernel for i386, if that matters :)

-- 
Totus tuus, Glebius.
Received on Sun Apr 05 2015 - 18:17:52 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:56 UTC