From nobody@FreeBSD.org  Tue Apr 13 00:11:09 2010
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 943EF106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 13 Apr 2010 00:11:09 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 7883C8FC0C
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 13 Apr 2010 00:11:09 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o3D0B9KK094095
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 13 Apr 2010 00:11:09 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o3D0B9J3094094;
	Tue, 13 Apr 2010 00:11:09 GMT
	(envelope-from nobody)
Message-Id: <201004130011.o3D0B9J3094094@www.freebsd.org>
Date: Tue, 13 Apr 2010 00:11:09 GMT
From: Florian Heigl <florian.heigl@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Xen: mutex vm page queue mutex not owned
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         145664
>Category:       kern
>Synopsis:       [xen] mutex vm page queue mutex not owned
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-xen
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr 13 00:20:01 UTC 2010
>Closed-Date:    Sun Nov 28 15:45:58 UTC 2010
>Last-Modified:  Sun Nov 28 15:45:58 UTC 2010
>Originator:     Florian Heigl
>Release:        8.0-RELEASE-p2
>Organization:
wartungsfenster.de
>Environment:
FreeBSD waxu0014 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 #0: Sun Apr 11 23:17:15 UTC 2010     root@waxu0013:/usr/obj/usr/src/sys/XEN  i386

Xen Host:
Linux waxh0004 2.6.18-128.2.1.4.9.el5xen #1 SMP Fri Oct 9 14:57:31 EDT 2009 i686 i686 i386 GNU/Linux


xen_major              : 3
xen_minor              : 4
xen_extra              : .0
xen_caps               : xen-3.0-x86_64 xen-3.0-x86_32p


(this is oracle vm 2.2)
>Description:
FreeBSD 8 PV domU will panic when a certain port tries to call a function called mlock().

I have already installed a fresh world and kernel, but the problem persisted.
Right now I think I missed some updates, so I'll cvsup again.
Opening the PR anyway. If I see it's fixed by now I'll just close it.


Apparently the error is also reported here:
http://www.mail-archive.com/freebsd-xen@freebsd.org/msg00404.html

I feel it is NOT a random stray but related to this function. The system went through a whole buildworld & buildkernel w/o issue.




make install clean at /usr/ports/met-mgmt/jffnms
[... marches away till I think the following dependency]
===>  Building for libgpg-error-1.7
[...]
checking for fcntl... yes
checking for ftruncate... yes
checking for mlock... yes
checking for sysconf... (cached) yes
checking for getpagesize... (cached) yes
checking whether mlock is broken... panic: mutex vm page queue mutex not owned at /usr/src/sys/i386/xen/xen_machdep.c:409
cpuid = 0
KDB: enter: panic
[thread pid 9635 tid 100074 ]
Stopped at      kdb_enter+0x3a: movl    $0,kdb_why




db> next
After 2 instructions (0 loads, 0 stores),
[thread pid 9635 tid 100074 ]
Stopped at      kdb_enter+0x45: ret
db> trace
Tracing pid 9635 tid 100074 td 0xc38706c0
kdb_enter(c0357750,c037b11d,c0382fd9,199,e4cc3b18,...) at kdb_enter+0x45
_mtx_assert(c03ec844,4,c0382fd9,199,0,...) at _mtx_assert+0x87
_xen_queue_pt_update(34ce320,2,52e4000,2,c0384661,...) at _xen_queue_pt_update+0x4c
pmap_extract(c34f1d98,28202000,c00c92c6,c3c54660,c34f1d98,...) at pmap_extract+0x251
vm_fault_unwire(c34f1ce8,28202000,28203000,0,0,...) at vm_fault_unwire+0x32
vm_map_delete(c34f1ce8,1000,bf800000,1,c34f1ce8,...) at vm_map_delete+0x16f
vm_map_remove(c34f1ce8,1000,bf800000,0,c3568780,...) at vm_map_remove+0x51
vmspace_exit(c38706c0,0,c0354336,12d,c00da56e,...) at vmspace_exit+0xbf
exit1(c38706c0,0,e4cc3d3c,c032f993,c38706c0,...) at exit1+0x5bb
sys_exit(c38706c0,e4cc3d08,4,c,c039687c,...) at sys_exit+0x1d
syscall(e4cc3d48) at syscall+0x2a3
Xint0x80_syscall() at Xint0x80_syscall+0x22
--- syscall (1, FreeBSD ELF32, sys_exit), eip = 0x281000af, esp = 0xbf7fe88c, ebp = 0xbf7fe898 --






Problem is that this problem + softupdates always leads to quite massive inconsistencies.

(So far this is a 100% showstopper and forcing me to run a XenServer or VMWare host for FreeBSD)


>How-To-Repeat:
build jffnms (or maybe just call to mlock)
>Fix:
not known, but I saw changes for this problem in relation to Xen were made to pmap.c back in 6.3. Might be worth comparing, but this file is far above my head :)

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-i386->freebsd-xen 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Mon Apr 19 05:06:36 UTC 2010 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=145664 
State-Changed-From-To: open->closed 
State-Changed-By: cperciva 
State-Changed-When: Sun Nov 28 15:45:32 UTC 2010 
State-Changed-Why:  
Duplicate of kern/140313. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=145664 
>Unformatted:
