freebsd-dev/sys
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
..
alpha Add bus_dmamap_load_mbuf_sg() to alpha. 2005-01-15 20:11:25 +00:00
amd64 Remove redundant code to drop per-thread debug register state from 2005-01-14 20:16:41 +00:00
arm Add support for KTR_BUSDMA. 2005-01-15 19:42:28 +00:00
boot Only update the boot sector when there is a valid drive number provided. 2005-01-09 23:30:35 +00:00
cam Start each of the license/copyright comments with /*- 2005-01-05 22:34:37 +00:00
coda Ditch vfs_object_create() and make the callers call VOP_CREATEVOBJECT() 2005-01-13 12:25:19 +00:00
compat Fix a problem reported by Pierre Beyssac. Sometinmes when ndis_get_info() 2005-01-14 22:39:44 +00:00
conf If USER of HOSTNAME is set to an empty value, use the fallback value. 2005-01-15 13:25:41 +00:00
contrib This commit was generated by cvs2svn to compensate for changes in r140216, 2005-01-14 06:37:43 +00:00
crypto Start the dreaded NOFOO -> NO_FOO conversion. 2004-12-21 08:47:35 +00:00
ddb Start each of the license/copyright comments with /*- 2005-01-06 01:34:41 +00:00
dev Convert if_em to the new bus_dmamap_load_sg() interface. The old callback 2005-01-15 20:52:15 +00:00
doc Experimental support for using doxygen to generate kernel documentation. 2004-07-11 16:13:57 +00:00
fs NULL-terminate the . and .. directory entries. Apparently some tools ignore 2005-01-14 16:35:34 +00:00
gdb /* -> /*- for copyright notices, minor format tweaks as necessary 2005-01-06 18:27:30 +00:00
geom CAM will sometimes remove a disk again even before it finished being 2005-01-14 21:05:35 +00:00
gnu Eliminate unused and unnecessary "cred" argument from vinvalbuf() 2005-01-14 07:33:51 +00:00
i4b /* -> /*- for copyright notices, minor format tweaks as necessary 2005-01-06 22:18:23 +00:00
i386 Bah, another whitespace fix. 2005-01-14 20:50:52 +00:00
ia64 Fix an assignment that I missed in the last commit. 2005-01-15 20:03:59 +00:00
isa Make life for owners of Synaptics Touchpads more pleasant :-) 2005-01-10 13:05:58 +00:00
isofs/cd9660 Wrap the bufobj operations in macros: BO_STRATEGY() and BO_WRITE() 2005-01-11 09:10:46 +00:00
kern make umtx timeout relative so userland can select different clock type, 2005-01-14 13:38:15 +00:00
libkern /* -> /*- for copyright notices, minor format tweaks as necessary 2005-01-07 00:24:33 +00:00
modules Connect SHSEC GEOM class to the build. 2005-01-11 18:18:40 +00:00
net o Clean up interface between ip_fw_chk() and its callers: 2005-01-14 09:00:46 +00:00
net80211 Correct scan candidate selection logic for dual-band devices: prefer 2005-01-01 17:48:27 +00:00
netatalk /* -> /*- for license, minor formatting changes, insert COPYRIGHT into files 2005-01-07 02:35:34 +00:00
netatm /* -> /*- for license, minor formatting changes 2005-01-07 01:45:51 +00:00
netgraph Raise & drop IFF_RUNNING upon receival of netgraph flow control 2005-01-14 11:55:07 +00:00
netinet o Clean up interface between ip_fw_chk() and its callers: 2005-01-14 09:00:46 +00:00
netinet6 /* -> /*- for license, minor formatting changes, separate for KAME 2005-01-07 02:30:35 +00:00
netipsec /* -> /*- for license, minor formatting changes 2005-01-07 01:45:51 +00:00
netipx Mark the IPX netisr as MPSAFE so that inbound IPX traffic is processed 2005-01-09 07:34:55 +00:00
netkey fixed an unexpected addr/port matching failure in IPv6 SA management 2005-01-10 13:06:42 +00:00
netnatm /* -> /*- for license, minor formatting changes 2005-01-07 01:45:51 +00:00
netncp /* -> /*- for license, minor formatting changes 2005-01-07 01:45:51 +00:00
netsmb /* -> /*- for license, minor formatting changes 2005-01-07 01:45:51 +00:00
nfs /* -> /*- for license, minor formatting changes 2005-01-07 01:45:51 +00:00
nfs4client This file fell out of the list when adding bufsync. 2005-01-11 11:36:26 +00:00
nfsclient Eliminate unused and unnecessary "cred" argument from vinvalbuf() 2005-01-14 07:33:51 +00:00
nfsserver Ditch vfs_object_create() and make the callers call VOP_CREATEVOBJECT() 2005-01-13 12:25:19 +00:00
opencrypto /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
pc98 In my last commit, I'd assumed that LINE30 was always defined. It 2005-01-09 22:17:39 +00:00
pccard /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
pci Reimplement the fix in rev. 1.126. 2005-01-10 09:56:47 +00:00
posix4 /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
powerpc Add bus_dmamap_load_mbuf_sg() to powerpc. 2005-01-15 19:55:25 +00:00
rpc /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
security Exempt the superuser from mac_seeotheruids checks. 2005-01-03 12:08:18 +00:00
sparc64 Add the bus_dmamap_load_mbuf_sg() function to sparc64. 2005-01-15 09:20:47 +00:00
sys Add a cast to fix a warning. 2005-01-15 02:43:31 +00:00
tools Get rid of the VDESC() macro while the pot is boiling anyway, it is 2005-01-13 08:05:20 +00:00
ufs Fix ACLs handling for the root file system. 2005-01-15 17:09:53 +00:00
vm Consider three objects, O, BO, and BBO, where BO is O's backing object 2005-01-15 21:12:47 +00:00
Makefile Add a NO_BOOT knob to prevent building the boot blocks and loader. 2004-08-19 09:54:28 +00:00