Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Apr 2000 10:36:15 -0700 (PDT)
From:      Matthew Dillon <dillon@apollo.backplane.com>
To:        Brian Fundakowski Feldman <green@FreeBSD.org>
Cc:        Alfred Perlstein <bright@wintelcom.net>, Michael Reifenberger <root@nihil.plaut.de>, current@FreeBSD.org, alc@FreeBSD.org
Subject:   Anyone able to verify the fix for (was Re: panic: vm_object_shadow: source object has OBJ_ONEMAPPING set.)
Message-ID:  <200004181736.KAA14683@apollo.backplane.com>
References:   <Pine.BSF.4.21.0004151755001.17351-100000@green.dyndns.org>

next in thread | previous in thread | raw e-mail | index | archive | help
    Has Brian or Michael or anyone been able to verify whether my patch
    below fixes the reported vm_object_shadow panics yet?  I'd like to get 
    it committed (or scrapped).

						-Matt


Index: vm_map.c
===================================================================
RCS file: /home/ncvs/src/sys/vm/vm_map.c,v
retrieving revision 1.187
diff -u -r1.187 vm_map.c
--- vm_map.c	2000/02/28 04:10:35	1.187
+++ vm_map.c	2000/04/15 18:02:06
@@ -2119,10 +2119,14 @@
 			}
 
 			/*
-			 * Add the reference before calling vm_object_shadow
-			 * to insure that a shadow object is created.
+			 * Clear OBJ_ONEMAPPING before calling vm_object_shadow
+			 * to ensure that a shadow object is created.  Add a
+			 * reference to cover the new vm_map_entry being
+			 * associated with the object.
 			 */
 			vm_object_reference(object);
+			vm_object_clear_flag(object, OBJ_ONEMAPPING);
+
 			if (old_entry->eflags & MAP_ENTRY_NEEDS_COPY) {
 				vm_object_shadow(&old_entry->object.vm_object,
 					&old_entry->offset,
@@ -2130,7 +2134,6 @@
 				old_entry->eflags &= ~MAP_ENTRY_NEEDS_COPY;
 				object = old_entry->object.vm_object;
 			}
-			vm_object_clear_flag(object, OBJ_ONEMAPPING);
 
 			/*
 			 * Clone the entry, referencing the shared object.
Index: vm_object.c
===================================================================
RCS file: /home/ncvs/src/sys/vm/vm_object.c,v
retrieving revision 1.171.2.1
diff -u -r1.171.2.1 vm_object.c
--- vm_object.c	2000/03/17 10:47:35	1.171.2.1
+++ vm_object.c	2000/04/15 18:13:58
@@ -900,7 +900,13 @@
 	source = *object;
 
 	/*
-	 * Don't create the new object if the old object isn't shared.
+	 * If the old object is not shared we may be able to simply use it
+	 * as the shadow rather then have to create a new object.  Only
+	 * objects that we can guarentee this case can be optimized - that is,
+	 * only objects with no handles that other processes can get a hold
+	 * of which are otherwise unassociated, have only one mapping, and
+	 * only one reference count.  XXX do we need the reference count check
+	 * any more? XXX
 	 */
 
 	if (source != NULL &&




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




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