Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Apr 2010 17:29:59 +0300
From:      Kostik Belousov <kostikbel@gmail.com>
To:        Rui Paulo <rpaulo@freebsd.org>
Cc:        Alan Cox <alc@freebsd.org>, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r206140 - head/sys/vm
Message-ID:  <20100405142959.GN2415@deviant.kiev.zoral.com.ua>
In-Reply-To: <A91C9366-6DB6-492C-A5D7-0366B934300C@freebsd.org>
References:  <201004031620.o33GKM0n037332@svn.freebsd.org> <A91C9366-6DB6-492C-A5D7-0366B934300C@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--QiPs+vIMjk/XMT1Q
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Apr 05, 2010 at 02:58:53PM +0100, Rui Paulo wrote:
> Hi,
>=20
> On 3 Apr 2010, at 17:20, Alan Cox wrote:
>=20
> > Author: alc
> > Date: Sat Apr  3 16:20:22 2010
> > New Revision: 206140
> > URL: http://svn.freebsd.org/changeset/base/206140
> >=20
> > Log:
> >  Re-enable the call to pmap_release() by vmspace_dofree().  The account=
ing
> >  problem that is described in the comment has been addressed.
> >=20
> >  Submitted by:	kib
> >  Tested by:	pho (a few months ago)
> >  MFC after:	6 weeks
> >=20
> > Modified:
> >  head/sys/vm/vm_map.c
> >=20
> > Modified: head/sys/vm/vm_map.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=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
> > --- head/sys/vm/vm_map.c	Sat Apr  3 15:52:32 2010	(r206139)
> > +++ head/sys/vm/vm_map.c	Sat Apr  3 16:20:22 2010	(r206140)
> > @@ -313,6 +313,7 @@ vm_init2(void)
> > static inline void
> > vmspace_dofree(struct vmspace *vm)
> > {
> > +
> > 	CTR1(KTR_VM, "vmspace_free: %p", vm);
> >=20
> > 	/*
> > @@ -329,12 +330,8 @@ vmspace_dofree(struct vmspace *vm)
> > 	(void)vm_map_remove(&vm->vm_map, vm->vm_map.min_offset,
> > 	    vm->vm_map.max_offset);
> >=20
> > -	/*
> > -	 * XXX Comment out the pmap_release call for now. The
> > -	 * vmspace_zone is marked as UMA_ZONE_NOFREE, and bugs cause
> > -	 * pmap.resident_count to be !=3D 0 on exit sometimes.
> > -	 */
> > -/* 	pmap_release(vmspace_pmap(vm)); */
> > +	pmap_release(vmspace_pmap(vm));
> > +	vm->vm_map.pmap =3D NULL;
> > 	uma_zfree(vmspace_zone, vm);
> > }
> >=20
>=20
> Unfortunately, this causes a panic on MIPS. I don't know enough about the=
 VM subsystem to help with fixing this but if you want me to investigate so=
mething, I can do it.
>=20
> NFS ROOT: 192.168.5.1:/zoo/rpaulo/millipede1
> warning: no time-of-day clock registered, system time will not be set acc=
urately
> warning: no time-of-day clock registered, system time will not be set acc=
urately
> Interface rge1 IP-Address 192.168.5.16 Broadcast 192.168.5.255=20
> panic: lock "pmap" 0xc6c320dc already initialized
> KDB: enter: panic
> [ thread pid 31 tid 100042 ]
> Stopped at      kdb_enter+0x50: lui     at,0x8047
> db> bt
> Tracing pid 31 tid 100042 td 0xc829e260
> db_trace_thread+30 (?,?,?,?) ra 8011ee48 sp d37ed820 sz 24
> 8011ed2c+11c (0,?,ffffffff,?) ra 8011e4f0 sp d37ed838 sz 32
> 8011e15c+394 (?,?,?,?) ra 8011e680 sp d37ed858 sz 168
> db_command_loop+78 (?,?,?,?) ra 80120c98 sp d37ed900 sz 24
> 80120b90+108 (?,?,?,?) ra 80227c74 sp d37ed918 sz 424
> kdb_trap+10c (?,?,?,?) ra 8038b8fc sp d37edac0 sz 32
> trap+b88 (?,?,?,?) ra 80383fa8 sp d37edae0 sz 168
> MipsKernGenException+10c (0,a,804c2fe4,109) ra 80227ecc sp d37edb88 sz 200
> kdb_enter+50 (?,?,?,?) ra 801f2184 sp d37edc50 sz 24
> panic+f8 (?,803fb4e0,c6c320dc,c6c320dc) ra 80228a74 sp d37edc68 sz 40
> lock_init+30 (?,?,?,?) ra 801e2114 sp d37edc90 sz 24
> mtx_init+100 (?,?,?,?) ra 80386fd4 sp d37edca8 sz 32
> pmap_pinit+34 (?,?,?,?) ra 8036dab8 sp d37edcc8 sz 48
> vmspace_alloc+48 (?,?,?,?) ra 8036dc08 sp d37edcf8 sz 32
> vmspace_fork+58 (c6c320f0,d37edd78,?,?) ra 801c7240 sp d37edd18 sz 72
> fork1+234 (?,?,?,d37eddc8) ra 801c845c sp d37edd60 sz 88
> fork+20 (?,?,?,?) ra 8038b694 sp d37eddb8 sz 32
> trap+920 (?,?,?,?) ra 80384174 sp d37eddd8 sz 168
> MipsUserGenException+10c (?,?,?,501dbd30) ra 0 sp d37ede80 sz 0
> pid 31 =20

I did not even compiled the change below.

diff --git a/sys/mips/mips/pmap.c b/sys/mips/mips/pmap.c
index 73f57e4..d5765ea 100644
--- a/sys/mips/mips/pmap.c
+++ b/sys/mips/mips/pmap.c
@@ -1263,6 +1263,7 @@ pmap_release(pmap_t pmap)
 	ptdpg->wire_count--;
 	atomic_subtract_int(&cnt.v_wire_count, 1);
 	vm_page_free_zero(ptdpg);
+	PMAP_LOCK_DESTROY(pmap);
 }
=20
 /*

--QiPs+vIMjk/XMT1Q
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEYEARECAAYFAku58+YACgkQC3+MBN1Mb4jRDQCgwwuEAg+hqxoTzKldpWDh/fpi
2wkAn2p6nDldQDvtm3o8Fn83qMsJ8vmy
=4MxC
-----END PGP SIGNATURE-----

--QiPs+vIMjk/XMT1Q--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100405142959.GN2415>