From owner-freebsd-current@FreeBSD.ORG Tue Feb 22 14:27: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 3690116A4CE; Tue, 22 Feb 2005 14:27:08 +0000 (GMT) Received: from tigra.ip.net.ua (tigra.ip.net.ua [82.193.96.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 538AF43D5C; Tue, 22 Feb 2005 14:27:07 +0000 (GMT) (envelope-from ru@ip.net.ua) Received: from localhost (rocky.ip.net.ua [82.193.96.2]) by tigra.ip.net.ua (8.12.11/8.12.11) with ESMTP id j1MER4L4094151; Tue, 22 Feb 2005 16:27:04 +0200 (EET) (envelope-from ru@ip.net.ua) Received: from tigra.ip.net.ua ([82.193.96.10]) by localhost (rocky.ipnet [82.193.96.2]) (amavisd-new, port 10024) with LMTP id 96498-07; Tue, 22 Feb 2005 16:27:03 +0200 (EET) Received: from heffalump.ip.net.ua (heffalump.ip.net.ua [82.193.96.213]) by tigra.ip.net.ua (8.12.11/8.12.11) with ESMTP id j1MER3uh094142 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 22 Feb 2005 16:27:03 +0200 (EET) (envelope-from ru@ip.net.ua) Received: (from ru@localhost) by heffalump.ip.net.ua (8.13.1/8.13.1) id j1MERBPB042766; Tue, 22 Feb 2005 16:27:11 +0200 (EET) (envelope-from ru) Date: Tue, 22 Feb 2005 16:27:11 +0200 From: Ruslan Ermilov To: Bosko Milekic , Alan Cox Message-ID: <20050222142710.GA42507@ip.net.ua> References: <20050222110318.GA41460@ip.net.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="T4sUOijqQbZv57TR" Content-Disposition: inline In-Reply-To: <20050222110318.GA41460@ip.net.ua> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at ip.net.ua cc: current@FreeBSD.org cc: Peter Grehan 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 14:27:08 -0000 --T4sUOijqQbZv57TR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 22, 2005 at 01:03:18PM +0200, Ruslan Ermilov wrote: > Hi, >=20 > I'm repeatedly getting the following panic (three-four times a day) > on sparc64 running a fresh -CURRENT, building world: >=20 > db> show msgbuf > panic: mutex vm object not owned at /usr/src/sys/vm/vm_page.c:608 > cpuid =3D 0 > KDB: enter: panic > exclusive sleep mutex vm page queue mutex r =3D 0 (0xc04be700) locked @ /= usr/src/sys/sparc64/sparc64/vm_machdep.c:483 > exclusive sleep mutex UMA lock r =3D 0 (0xc04bdcc0) locked @ /usr/src/sys= /vm/uma_core.c:1485 > exclusive sleep mutex Giant r =3D 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 >=20 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 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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; =20 PMAP_STATS_INC(uma_nsmall_free); m =3D PHYS_TO_VM_PAGE(TLB_DIRECT_TO_PHYS((vm_offset_t)mem)); + object =3D m->object; + VM_OBJECT_LOCK(object); vm_page_lock_queues(); vm_page_free(m); vm_page_unlock_queues(); + VM_OBJECT_UNLOCK(object); } %%% Cheers, --=20 Ruslan Ermilov ru@FreeBSD.org FreeBSD committer --T4sUOijqQbZv57TR Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQFCG0E+qRfpzJluFF4RAn1WAJ9qaN3eV/l1nUIXt8GTLjHrs5rMcgCeKYVt eX/nqMSHH9H3doBQMdJgig0= =XR+f -----END PGP SIGNATURE----- --T4sUOijqQbZv57TR--