svn commit: r346660 - stable/12/sys/vm

Mark Johnston markj at FreeBSD.org
Thu Apr 25 03:48:38 UTC 2019


Author: markj
Date: Thu Apr 25 03:48:37 2019
New Revision: 346660
URL: https://svnweb.freebsd.org/changeset/base/346660

Log:
  MFC r346543:
  Disable vm map consistency checking by default on INVARIANTS kernels.

Modified:
  stable/12/sys/vm/vm_map.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/vm/vm_map.c
==============================================================================
--- stable/12/sys/vm/vm_map.c	Thu Apr 25 03:47:32 2019	(r346659)
+++ stable/12/sys/vm/vm_map.c	Thu Apr 25 03:48:37 2019	(r346660)
@@ -670,6 +670,14 @@ _vm_map_assert_locked(vm_map_t map, const char *file, 
 #define	VM_MAP_ASSERT_LOCKED(map) \
     _vm_map_assert_locked(map, LOCK_FILE, LOCK_LINE)
 
+#ifdef DIAGNOSTIC
+static int enable_vmmap_check = 1;
+#else
+static int enable_vmmap_check = 0;
+#endif
+SYSCTL_INT(_debug, OID_AUTO, vmmap_check, CTLFLAG_RWTUN,
+    &enable_vmmap_check, 0, "Enable vm map consistency checking");
+
 static void
 _vm_map_assert_consistent(vm_map_t map)
 {
@@ -677,6 +685,9 @@ _vm_map_assert_consistent(vm_map_t map)
 	vm_map_entry_t child;
 	vm_size_t max_left, max_right;
 
+	if (!enable_vmmap_check)
+		return;
+
 	for (entry = map->header.next; entry != &map->header;
 	    entry = entry->next) {
 		KASSERT(entry->prev->end <= entry->start,
@@ -714,7 +725,7 @@ _vm_map_assert_consistent(vm_map_t map)
 #else
 #define	VM_MAP_ASSERT_LOCKED(map)
 #define VM_MAP_ASSERT_CONSISTENT(map)
-#endif
+#endif /* INVARIANTS */
 
 /*
  *	_vm_map_unlock_and_wait:


More information about the svn-src-stable mailing list