freebsd-skq/sys/vm
alc 2c4b57d486 Fix the root cause of the "vm_reserv_populate: reserv <address> is already
promoted" panics.  The sequence of events that leads to a panic is rather
long and circuitous.  First, suppose that process P has a promoted
superpage S within vm object O that it can write to.  Then, suppose that P
forks, which leads to S being write protected.  Now, before P's child
exits, suppose that P writes to another virtual page within O.  Since the
pages within O are copy on write, a shadow object for O is created to
house the new physical copy of the faulted on virtual page.  Then, before
P can fault on S, P's child exists.  Now, when P faults on S, it will
follow the "optimized" path for copy-on-write faults in vm_fault(),
wherein the underlying physical page is moved from O to its shadow object
rather than allocating a new page and copying the new page's contents from
the old page.  Moreover, suppose that every 4 KB physical page making up S
is moved to the shadow object in this way.  However, the optimized path
does not move the underlying superpage reservation, which is the root
cause of the panics!  Ultimately, P performs vm_object_collapse() on O's
shadow object, which destroys O and in doing so breaks any reservations
still belonging to O.  This leaves the reservation underlying S in an
inconsistent state: It's simultaneously not in use and promoted.  Breaking
a reservation does not demote it because I never intended for a promoted
reservation to be broken.  It makes little sense.  Finally, this
inconsistency leads to an assertion failure the next time that the
reservation is used.

The failing assertion does not (currently) exist in FreeBSD 10.x or
earlier.  There, we will quietly break the promoted reservation.  While
illogical and unintended, breaking the reservation is essentially
harmless.

PR:		198163
Reviewed by:	kib
Tested by:	pho
X-MFC after:	r267213
Sponsored by:	EMC / Isilon Storage Division
2015-03-19 01:40:43 +00:00
..
_vm_radix.h
default_pager.c
device_pager.c
memguard.c Some minor style(9) fixes (whitespace + comment) 2015-02-17 08:50:26 +00:00
memguard.h
phys_pager.c
pmap.h
redzone.c
redzone.h
sg_pager.c
swap_pager.c
swap_pager.h
uma_core.c Set the SBUF_INCLUDENUL flag in sbuf_new_for_sysctl() so that sysctl 2015-03-14 17:08:28 +00:00
uma_dbg.c
uma_dbg.h
uma_int.h
uma.h
vm_extern.h
vm_fault.c Fix the root cause of the "vm_reserv_populate: reserv <address> is already 2015-03-19 01:40:43 +00:00
vm_glue.c
vm_init.c
vm_kern.c
vm_kern.h
vm_map.c
vm_map.h
vm_meter.c
vm_mmap.c Eliminate a variable that became unused when VFS_LOCK_GIANT() was 2015-02-28 19:11:37 +00:00
vm_object.c Correct a typo in vm_object_backing_scan() that originated in r254141. 2015-03-07 04:18:40 +00:00
vm_object.h Update mtime for tmpfs files modified through memory mapping. Similar 2015-01-28 10:37:23 +00:00
vm_page.c
vm_page.h
vm_pageout.c Add vm.panic_on_oom sysctl, which enables those who would rather panic than 2015-01-24 17:32:45 +00:00
vm_pageout.h
vm_pager.c o Enhance vm_pager_free_nonreq() function: 2015-03-17 19:19:19 +00:00
vm_pager.h o Enhance vm_pager_free_nonreq() function: 2015-03-17 19:19:19 +00:00
vm_param.h
vm_phys.c Revert r279932; this is going to be fixed in the sbuf code instead. 2015-03-14 13:00:37 +00:00
vm_phys.h
vm_radix.c
vm_radix.h
vm_reserv.c Revert r279932; this is going to be fixed in the sbuf code instead. 2015-03-14 13:00:37 +00:00
vm_reserv.h
vm_unix.c
vm_zeroidle.c
vm.h
vnode_pager.c o Enhance vm_pager_free_nonreq() function: 2015-03-17 19:19:19 +00:00
vnode_pager.h