Date: Wed, 11 Sep 2019 04:59:27 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r352203 - stable/11/sys/vm Message-ID: <201909110459.x8B4xRum063104@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201909110459.x8B4xRum063104>