1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-25 11:37:56 +00:00
freebsd/sys/vm
Alan Cox d936694f09 Consider three objects, O, BO, and BBO, where BO is O's backing object
and BBO is BO's backing object.  Now, suppose that O and BO are being
collapsed.  Furthermore, suppose that BO has been marked dead
(OBJ_DEAD) by vm_object_backing_scan() and that either
vm_object_backing_scan() has been forced to sleep due to encountering
a busy page or vm_object_collapse() has been forced to sleep due to
memory allocation in the swap pager.  If vm_object_deallocate() is
then called on BBO and BO is BBO's only shadow object,
vm_object_deallocate() will collapse BO and BBO.  In doing so, it adds
a necessary temporary reference to BO.  If this collapse also sleeps
and the prior collapse resumes first, the temporary reference will
cause vm_object_collapse to panic with the message "backing_object %p
was somehow re-referenced during collapse!"

Resolve this race by changing vm_object_deallocate() such that it
doesn't collapse BO and BBO if BO is marked dead.  Once O and BO are
collapsed, vm_object_collapse() will attempt to collapse O and BBO.
So, vm_object_deallocate() on BBO need do nothing.

Reported by: Peter Holm on 20050107
URL: http://www.holm.cc/stress/log/cons102.html

In collaboration with: tegge@
Candidate for RELENG_4 and RELENG_5
MFC after: 2 weeks
2005-01-15 21:12:47 +00:00
..
default_pager.c /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
device_pager.c /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
phys_pager.c /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
pmap.h /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
swap_pager.c /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
swap_pager.h /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
uma_core.c While we want the recursion protection for the bucket zones so that 2005-01-11 03:33:09 +00:00
uma_dbg.c /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
uma_dbg.h /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
uma_int.h /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
uma.h /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_contig.c /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_extern.h Disable U area swapping and remove the routines that create, destroy, 2004-11-20 02:29:00 +00:00
vm_fault.c /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_glue.c /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_init.c /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_kern.c /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_kern.h /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_map.c /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_map.h /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_meter.c /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_mmap.c /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_object.c Consider three objects, O, BO, and BBO, where BO is O's backing object 2005-01-15 21:12:47 +00:00
vm_object.h /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_page.c Transfer responsibility for freeing the page taken from the cache 2005-01-07 05:02:19 +00:00
vm_page.h /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_pageout.c /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_pageout.h /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_pageq.c Remove references to L1 in the comments, according to Alan they are 2004-06-07 19:33:05 +00:00
vm_pager.c /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_pager.h /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_param.h /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_unix.c /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_zeroidle.c Remove dangling variable 2004-11-06 11:33:11 +00:00
vm.h /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vnode_pager.c /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vnode_pager.h /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00