PERFORCE change 183712 for review

Edward Tomasz Napierala trasz at FreeBSD.org
Mon Sep 13 13:58:04 UTC 2010


http://p4web.freebsd.org/@@183712?ac=10

Change 183712 by trasz at trasz_victim on 2010/09/13 13:58:02

	Try to fix panics I've been seeing occasionaly.

Affected files ...

.. //depot/projects/soc2009/trasz_limits/sys/vm/swap_pager.c#8 edit
.. //depot/projects/soc2009/trasz_limits/sys/vm/vm_pageout.c#16 edit

Differences ...

==== //depot/projects/soc2009/trasz_limits/sys/vm/swap_pager.c#8 (text+ko) ====

@@ -2438,6 +2438,11 @@
 	vm_map_entry_t cur;
 	int count = 0;
 
+#if 0
+	/* Panics the kernel at startup. */
+	KASSERT(vm_map_locked(map), ("vm_map not locked"));
+#endif
+
 	for (cur = map->header.next; cur != &map->header; cur = cur->next) {
 		vm_object_t object;
 

==== //depot/projects/soc2009/trasz_limits/sys/vm/vm_pageout.c#16 (text+ko) ====

@@ -1722,8 +1722,11 @@
 			 * I want to get a better feeling on how the memory
 			 * management works.  In other words, it's post-shm task.
 			 */
-			size = vmspace_swap_count(vm);
-			rusage_set(p, RUSAGE_SWAP, IDX_TO_OFF(size));
+			if (vm_map_trylock_read(&vm->vm_map)) {
+				size = vmspace_swap_count(vm);
+				vm_map_unlock_read(&vm->vm_map);
+				rusage_set(p, RUSAGE_SWAP, IDX_TO_OFF(size));
+			}
 #endif
 			vmspace_free(vm);
 		}


More information about the p4-projects mailing list