Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Mar 1996 02:09:09 +0900
From:      KATO Takenori <kato@eclogite.eps.nagoya-u.ac.jp>
To:        p.richards@elsevier.co.uk
Cc:        freebsd-current@freebsd.org
Subject:   Re: Whee! Page Fault!
Message-ID:  <199603181709.CAA00868@marble.eps.nagoya-u.ac.jp>
In-Reply-To: Your message of "Mon, 18 Mar 1996 15:45:38 GMT"
References:  <199603181545.PAA04484@tees>

next in thread | previous in thread | raw e-mail | index | archive | help
> but I'm not sure it's the only cause since I wasn't using the cdrom the
> first time it happened.

I don't access CDROM, but I also have numerous panics, and couldn't
boot FreeBSD-current box.  For example, After fsck in rc, my 5x86 box
shows following messages: 

  panic: freeing held page, count=1
  Debugger("panic")
  Stopped at     _Debugger+0x2a: movb    $0,_in_Debugger.110
  _Debugger(f0b48800,5800,1,0,f0b48864) at _Debugger+0x2a
  _trap_pfault(0,0,1,1,0) at _trap_pfault+0x10a
  (null)(10000,10,2,0,1) at 0
  (null)(0,0,0,0,0) at 0

and

  v_page_free: pindex(14), busy(0), PG_BUSY(0)
  panic: vm_page_free: freeing free page

I changed the code in vm_map_simplify_entry into revision 1.37 of
vm_map.c by following patch:

--------------------
*** vm_map.c.orig	Tue Mar 19 01:15:37 1996
--- vm_map.c	Tue Mar 19 01:15:20 1996
***************
*** 844,898 ****
  	 * neighbors.
  	 */
  
! 	if (entry->is_sub_map || entry->is_a_map || entry->wired_count)
  		return;
  
! 	prev = entry->prev;
! 	if (prev != &map->header) {
  		prevsize = prev->end - prev->start;
! 		if ( prev->end == entry->start &&
! 		     prev->object.vm_object == entry->object.vm_object &&
! 		     prev->offset + prevsize == entry->offset &&
! 		     prev->protection == entry->protection &&
! 		     prev->max_protection == entry->max_protection &&
! 		     prev->inheritance == entry->inheritance &&
! 		     prev->needs_copy == entry->needs_copy &&
! 		     prev->copy_on_write == entry->copy_on_write &&
! 		     prev->is_a_map == FALSE &&
! 		     prev->is_sub_map == FALSE &&
! 		     prev->wired_count == 0) {
! 			if (map->first_free == prev)
! 				map->first_free = entry;
! 			vm_map_entry_unlink(map, prev);
! 			entry->start = prev->start;
! 			entry->offset = prev->offset;
! 			vm_object_deallocate(prev->object.vm_object);
! 			vm_map_entry_dispose(map, prev);
! 		}
! 	}
! 
! 	next = entry->next;
! 	if (next != &map->header) {
  		nextsize = next->end - next->start;
  		esize = entry->end - entry->start;
! 		if (entry->end == next->start &&
! 		    next->object.vm_object == entry->object.vm_object &&
! 		    entry->offset + esize == next->offset &&
! 		    next->protection == entry->protection &&
! 		    next->max_protection == entry->max_protection &&
! 		    next->inheritance == entry->inheritance &&
! 		    next->needs_copy == entry->needs_copy &&
! 		    next->copy_on_write == entry->copy_on_write &&
! 		    next->is_a_map == FALSE &&
! 		    next->is_sub_map == FALSE &&
! 		    next->wired_count == 0) {
! 			if (map->first_free == next)
! 				map->first_free = entry;
! 			vm_map_entry_unlink(map, next);
! 			entry->end = next->end;
! 			vm_object_deallocate(next->object.vm_object);
! 			vm_map_entry_dispose(map, next);
! 	        }
  	}
  }
  
--- 848,904 ----
  	 * neighbors.
  	 */
  
! 	if (entry->is_sub_map)
  		return;
+ 	if (entry->is_a_map) {
+ 		return;
+ 	} else {
+ 		if (entry->wired_count)
+ 			return;
  
! 		prev = entry->prev;
  		prevsize = prev->end - prev->start;
! 		next = entry->next;
  		nextsize = next->end - next->start;
  		esize = entry->end - entry->start;
! 
! 		if (prev != &map->header &&
! 			prev->end == entry->start &&
! 			prev->is_a_map == FALSE &&
! 			prev->is_sub_map == FALSE &&
! 			prev->object.vm_object == entry->object.vm_object &&
! 			prev->protection == entry->protection &&
! 			prev->max_protection == entry->max_protection &&
! 			prev->inheritance == entry->inheritance &&
! 			prev->needs_copy == entry->needs_copy &&
! 			prev->copy_on_write == entry->copy_on_write &&
! 			prev->offset + prevsize == entry->offset &&
! 			prev->wired_count == 0) {
! 				vm_map_entry_unlink(map, prev);
! 				entry->start = prev->start;
! 				entry->offset = prev->offset;
! 				vm_object_deallocate(prev->object.vm_object);
! 				vm_map_entry_dispose(map, prev);
! 				esize = entry->end - entry->start;
! 		}
! 
! 		if (next != &map->header &&
! 			entry->end == next->start &&
! 			next->is_a_map == FALSE &&
! 			next->is_sub_map == FALSE &&
! 			next->object.vm_object == entry->object.vm_object &&
! 			next->protection == entry->protection &&
! 			next->max_protection == entry->max_protection &&
! 			next->inheritance == entry->inheritance &&
! 			next->needs_copy == entry->needs_copy &&
! 			next->copy_on_write == entry->copy_on_write &&
! 			entry->offset + esize == next->offset &&
! 			next->wired_count == 0) {
! 				vm_map_entry_unlink(map, next);
! 				entry->end = next->end;
! 				vm_object_deallocate(next->object.vm_object);
! 				vm_map_entry_dispose(map, next);
! 		}
  	}
  }
  
--------------------

After applying this patch, my FreeBSD box works without panic for 12
hours until now.

----
KATO Takenori <kato@eclogite.eps.nagoya-u.ac.jp>
Dept. Earth Planet. Sci., Nagoya Univ.,  Nagoya, 464-01, Japan
Voice: +81-52-789-2529   Fax: +81-52-789-3033



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