Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Apr 2019 03:48:37 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r346660 - stable/12/sys/vm
Message-ID:  <201904250348.x3P3mbOe006712@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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:



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