freebsd-skq/sys/vm
delphij 2841d31dff Try to close a potential, but serious race in our VM subsystem.
Historically, our contigmalloc1() and contigmalloc2() assumes
that a page in PQ_CACHE can be unconditionally reused by busying
and freeing it.  Unfortunatelly, when object happens to be not
NULL, the code will set m->object to NULL and disregard the fact
that the page is actually in the VM page bucket, resulting in
page bucket hash table corruption and finally, a filesystem
corruption, or a 'page not in hash' panic.

This commit has borrowed the idea taken from DragonFlyBSD's fix
to the VM fix by Matthew Dillon[1].  This version of patch will
do the following checks:

	- When scanning pages in PQ_CACHE, check hold_count and
	  skip over pages that are held temporarily.
	- For pages in PQ_CACHE and selected as candidate of being
	  freed, check if it is busy at that time.

Note:  It seems that this is might be unrelated to kern/72539.

Obtained from:	DragonFlyBSD, sys/vm/vm_contig.c,v 1.11 and 1.12 [1]
Reminded by:	Matt Dillon
Reworked by:	alc
MFC After:	1 week
2004-11-24 18:56:13 +00:00
..
default_pager.c
device_pager.c Use dev_re[fl]thread() to maintain a ref on the device driver while 2004-09-24 05:59:11 +00:00
phys_pager.c
pmap.h
swap_pager.c Disable U area swapping and remove the routines that create, destroy, 2004-11-20 02:29:00 +00:00
swap_pager.h
uma_core.c Abstract the logic to look up the uma_bucket_zone given a desired 2004-11-06 11:43:30 +00:00
uma_dbg.c Fix critical stability problems that can cause UMA mbuf cluster 2004-10-08 20:19:29 +00:00
uma_dbg.h
uma_int.h
uma.h
vm_contig.c Try to close a potential, but serious race in our VM subsystem. 2004-11-24 18:56:13 +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 Remove unnecessary check for curthread == NULL. 2004-10-17 20:29:28 +00:00
vm_glue.c Disable U area swapping and remove the routines that create, destroy, 2004-11-20 02:29:00 +00:00
vm_init.c
vm_kern.c Use VM_ALLOC_NOBUSY instead of calling vm_page_wakeup(). 2004-10-24 18:46:32 +00:00
vm_kern.h
vm_map.c Push Giant deep into vm_forkproc(), acquiring it only if the process has 2004-09-03 05:11:32 +00:00
vm_map.h
vm_meter.c Put on my peril sensitive sunglasses and add a flags field to the internal 2004-10-11 22:04:16 +00:00
vm_mmap.c Don't clear flags we just checked were not set. 2004-10-26 05:57:29 +00:00
vm_object.c Eliminate an unnecessary atomic operation. Articulate the rationale in 2004-11-06 21:48:45 +00:00
vm_object.h Move a call to wakeup() from vm_object_terminate() to vnode_pager_dealloc() 2004-11-06 05:33:02 +00:00
vm_page.c The synchronization provided by vm object locking has eliminated the 2004-11-03 20:17:31 +00:00
vm_page.h Introduce VM_ALLOC_NOBUSY, an option to vm_page_alloc() and vm_page_grab() 2004-10-24 06:15:36 +00:00
vm_pageout.c During traversal of the inactive queue, try locking the page's containing 2004-11-05 06:24:05 +00:00
vm_pageout.h Disable U area swapping and remove the routines that create, destroy, 2004-11-20 02:29:00 +00:00
vm_pageq.c
vm_pager.c Add pbgetbo()/pbrelbo() lighter weight versions of pbgetvp()/pbrelvp(). 2004-11-15 08:47:18 +00:00
vm_pager.h Improve readability with a bunch of typedefs for the pager ops. 2004-11-09 13:43:20 +00:00
vm_param.h #include <vm/vm_param.h> instead of <machine/vmparam.h> (the former 2004-11-08 18:20:02 +00:00
vm_unix.c
vm_zeroidle.c Remove dangling variable 2004-11-06 11:33:11 +00:00
vm.h
vnode_pager.c Make VOP_BMAP return a struct bufobj for the underlying storage device 2004-11-15 09:18:27 +00:00
vnode_pager.h