From owner-freebsd-current@FreeBSD.ORG Tue Feb 22 17:54:08 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1C6E616A4CE; Tue, 22 Feb 2005 17:54:08 +0000 (GMT) Received: from carver.gumbysoft.com (carver.gumbysoft.com [66.220.23.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id E509643D5C; Tue, 22 Feb 2005 17:54:07 +0000 (GMT) (envelope-from dwhite@gumbysoft.com) Received: by carver.gumbysoft.com (Postfix, from userid 1000) id D94D672DD8; Tue, 22 Feb 2005 09:54:07 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by carver.gumbysoft.com (Postfix) with ESMTP id D703B72DCB; Tue, 22 Feb 2005 09:54:07 -0800 (PST) Date: Tue, 22 Feb 2005 09:54:07 -0800 (PST) From: Doug White To: Ruslan Ermilov In-Reply-To: <20050222142710.GA42507@ip.net.ua> Message-ID: <20050222095206.A97883@carver.gumbysoft.com> References: <20050222110318.GA41460@ip.net.ua> <20050222142710.GA42507@ip.net.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Alan Cox cc: Bosko Milekic cc: Peter Grehan cc: current@FreeBSD.org Subject: Re: mutex lock assertion panic in vm_page_free() on sparc64 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.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: Tue, 22 Feb 2005 17:54:08 -0000 Sorry for the top post, but bosko is out of country for the next week or so. Soemone else should look at this and commit this workaround if it'll get us through the week. On Tue, 22 Feb 2005, Ruslan Ermilov wrote: > On Tue, Feb 22, 2005 at 01:03:18PM +0200, Ruslan Ermilov wrote: > > Hi, > > > > I'm repeatedly getting the following panic (three-four times a day) > > on sparc64 running a fresh -CURRENT, building world: > > > > db> show msgbuf > > panic: mutex vm object not owned at /usr/src/sys/vm/vm_page.c:608 > > cpuid = 0 > > KDB: enter: panic > > exclusive sleep mutex vm page queue mutex r = 0 (0xc04be700) locked @ /usr/src/sys/sparc64/sparc64/vm_machdep.c:483 > > exclusive sleep mutex UMA lock r = 0 (0xc04bdcc0) locked @ /usr/src/sys/vm/uma_core.c:1485 > > exclusive sleep mutex Giant r = 0 (0xc0422728) locked @ /usr/src/sys/vm/vm_pageout.c:666 > > db> where > > Tracing pid 7 tid 100016 td 0xfffff80067c0c720 > > panic() at panic+0x16c > > _mtx_assert() at _mtx_assert+0x6c > > vm_page_remove() at vm_page_remove+0x34 > > vm_page_free_toq() at vm_page_free_toq+0xb8 > > vm_page_free() at vm_page_free+0x10 > > uma_small_free() at uma_small_free+0x54 > > zone_drain() at zone_drain+0x2e8 > > zone_foreach() at zone_foreach+0x3c > > uma_reclaim() at uma_reclaim+0x10 > > vm_pageout_scan() at vm_pageout_scan+0x13c > > vm_pageout() at vm_pageout+0x3e8 > > fork_exit() at fork_exit+0x9c > > fork_trampoline() at fork_trampoline+0x8 > > > I have no idea if this is the correct fix or not, but the necessary > vm_object_t locking is certainly missing in uma_small_free() on all > architectures implementing it (alpha, amd64, ia64, powerpc, and > sparc64). > > %%% > Index: vm_machdep.c > =================================================================== > RCS file: /home/ncvs/src/sys/sparc64/sparc64/vm_machdep.c,v > retrieving revision 1.71 > diff -u -r1.71 vm_machdep.c > --- vm_machdep.c 19 Jan 2005 18:24:07 -0000 1.71 > +++ vm_machdep.c 22 Feb 2005 14:21:12 -0000 > @@ -67,6 +67,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -477,10 +478,14 @@ > uma_small_free(void *mem, int size, u_int8_t flags) > { > vm_page_t m; > + vm_object_t object; > > PMAP_STATS_INC(uma_nsmall_free); > m = PHYS_TO_VM_PAGE(TLB_DIRECT_TO_PHYS((vm_offset_t)mem)); > + object = m->object; > + VM_OBJECT_LOCK(object); > vm_page_lock_queues(); > vm_page_free(m); > vm_page_unlock_queues(); > + VM_OBJECT_UNLOCK(object); > } > %%% > > > Cheers, > -- Doug White | FreeBSD: The Power to Serve dwhite@gumbysoft.com | www.FreeBSD.org