svn commit: r206140 - head/sys/vm

Kostik Belousov kostikbel at gmail.com
Mon Apr 5 14:30:03 UTC 2010


On Mon, Apr 05, 2010 at 02:58:53PM +0100, Rui Paulo wrote:
> Hi,
> 
> On 3 Apr 2010, at 17:20, Alan Cox wrote:
> 
> > Author: alc
> > Date: Sat Apr  3 16:20:22 2010
> > New Revision: 206140
> > URL: http://svn.freebsd.org/changeset/base/206140
> > 
> > Log:
> >  Re-enable the call to pmap_release() by vmspace_dofree().  The accounting
> >  problem that is described in the comment has been addressed.
> > 
> >  Submitted by:	kib
> >  Tested by:	pho (a few months ago)
> >  MFC after:	6 weeks
> > 
> > Modified:
> >  head/sys/vm/vm_map.c
> > 
> > Modified: head/sys/vm/vm_map.c
> > ==============================================================================
> > --- 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);
> > 
> > 	/*
> > @@ -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);
> > 
> > -	/*
> > -	 * 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 != 0 on exit sometimes.
> > -	 */
> > -/* 	pmap_release(vmspace_pmap(vm)); */
> > +	pmap_release(vmspace_pmap(vm));
> > +	vm->vm_map.pmap = NULL;
> > 	uma_zfree(vmspace_zone, vm);
> > }
> > 
> 
> 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 something, I can do it.
> 
> NFS ROOT: 192.168.5.1:/zoo/rpaulo/millipede1
> warning: no time-of-day clock registered, system time will not be set accurately
> warning: no time-of-day clock registered, system time will not be set accurately
> Interface rge1 IP-Address 192.168.5.16 Broadcast 192.168.5.255 
> 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  

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);
 }
 
 /*
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/svn-src-all/attachments/20100405/f59f0545/attachment.pgp


More information about the svn-src-all mailing list