svn commit: r352203 - stable/11/sys/vm

Konstantin Belousov kib at FreeBSD.org
Wed Sep 11 04:59:28 UTC 2019


Author: kib
Date: Wed Sep 11 04:59:27 2019
New Revision: 352203
URL: https://svnweb.freebsd.org/changeset/base/352203

Log:
  MFC r351830:
  madvise(MADV_FREE): Quick fix to time rewind.
  
  PR:	240061

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

Modified: stable/11/sys/vm/vm_map.c
==============================================================================
--- stable/11/sys/vm/vm_map.c	Wed Sep 11 04:55:10 2019	(r352202)
+++ stable/11/sys/vm/vm_map.c	Wed Sep 11 04:59:27 2019	(r352203)
@@ -2279,6 +2279,18 @@ vm_map_madvise(
 			if (current->eflags & MAP_ENTRY_IS_SUB_MAP)
 				continue;
 
+			/*
+			 * MADV_FREE would otherwise rewind time to
+			 * the creation of the shadow object.  Because
+			 * we hold the VM map read-locked, neither the
+			 * entry's object nor the presence of a
+			 * backing object can change.
+			 */
+			if (behav == MADV_FREE &&
+			    current->object.vm_object != NULL &&
+			    current->object.vm_object->backing_object != NULL)
+				continue;
+
 			pstart = OFF_TO_IDX(current->offset);
 			pend = pstart + atop(current->end - current->start);
 			useStart = current->start;


More information about the svn-src-all mailing list