From owner-freebsd-current@FreeBSD.ORG Sun Apr 5 23:35:19 2015 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9AF20357; Sun, 5 Apr 2015 23:35:19 +0000 (UTC) Received: from pp1.rice.edu (proofpoint1.mail.rice.edu [128.42.201.100]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63018E3C; Sun, 5 Apr 2015 23:35:18 +0000 (UTC) Received: from pps.filterd (pp1.rice.edu [127.0.0.1]) by pp1.rice.edu (8.14.5/8.14.5) with SMTP id t35Mr5HH006851; Sun, 5 Apr 2015 17:57:10 -0500 Received: from mh3.mail.rice.edu (mh3.mail.rice.edu [128.42.199.10]) by pp1.rice.edu with ESMTP id 1tf8aybpg9-1; Sun, 05 Apr 2015 17:57:10 -0500 X-Virus-Scanned: by amavis-2.7.0 at mh3.mail.rice.edu, auth channel Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net (108-254-203-201.lightspeed.hstntx.sbcglobal.net [108.254.203.201]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh3.mail.rice.edu (Postfix) with ESMTPSA id A365D4038C; Sun, 5 Apr 2015 17:57:09 -0500 (CDT) Message-ID: <5521BDC4.2080103@rice.edu> Date: Sun, 05 Apr 2015 17:57:08 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Gleb Smirnoff Subject: Re: panic: Lock vm object not exclusively locked @ /usr/src/sys/vm/vm_page.c:2637 References: <20150405133758.GA40261@albert.catwhisker.org> <20150405154721.GO64665@FreeBSD.org> <5521749C.4020408@rice.edu> <20150405193425.GR64665@glebius.int.ru> <5521961C.8010808@rice.edu> <20150405201744.GV64665@glebius.int.ru> In-Reply-To: <20150405201744.GV64665@glebius.int.ru> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=13 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1504050222 Cc: alc@FreeBSD.org, current@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2015 23:35:19 -0000 On 04/05/2015 15:17, Gleb Smirnoff wrote: > 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 wro= te: > A> > A> > D> It ocurred rather late in the transition to multi-user mod= e, but > A> > A> > D> prior to starting xdm (on my laptop). > A> > A> > D>=20 > A> > A> > D> Previous (working) head/i386 for this machine was r281074.= > A> > A> > D>=20 > A> > A> > D> Here's the first bit of the crashinfo (yes, I have a crash= dump): > A> > A> > D>=20 > A> > A> > D> g1-254.catwhisker.org dumped core - see /var/crash/vmcore.= 3 > A> > A> > D>=20 > A> > A> > D> Sun Apr 5 06:18:44 PDT 2015 > A> > A> > D>=20 > A> > A> > D> FreeBSD g1-254.catwhisker.org 11.0-CURRENT FreeBSD 11.0-CU= RRENT #1561 r281106M/281106:1100067: Sun Apr 5 06:01:06 PDT 2015 ro= ot@g1-254.catwhisker.org:/common/S4/obj/usr/src/sys/CANARY i386 > A> > A> > D>=20 > A> > A> > D> panic: Lock vm object not exclusively locked @ /usr/src/sy= s/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_D= ONTNEED case, > A> > A> > the assertion is valid. So, looks like vm_fault_dontneed() ne= eds W-lock on > A> > A> > the first_object. > A> > A> > > A> > A>=20 > A> > A> Actually, what I forgot was that vm_page_advise(MADV_FREE) clea= rs the > A> > A> page's dirty field, and that is why an exclusive lock is assert= ed. As > A> > A> explained in vm_page.h, the pmap is allowed to set the dirty fi= eld 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.=20 > A> > A> vm_page_advise(MADV_DONTNEED) isn't really any different from t= he fast path. > A> > A>=20 > A> > A> Need to think a bit ... > A> > > A> > Can you please plug the panic somehow interim? For me the assert f= ires 100% > A> > reliably on any build attempt. Right now I changed vm_fault_dontne= ed() to > A> > take W-lock, so that I can continue running head. Not sure this is= correct > A> > measure. > A> > > A>=20 > A> Just curious, amd64 or i386? > > Panics on amd64...., while building a kernel for i386, if that matters = :) > Maybe. I didn't trip the assertion building amd64 kernels or world.=20 Maybe the difference is that the machine in question is still running a world from before the last clang update.