summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_object.c
diff options
context:
space:
mode:
authortegge <tegge@FreeBSD.org>2005-08-10 00:17:36 +0000
committertegge <tegge@FreeBSD.org>2005-08-10 00:17:36 +0000
commita73af1b81d7cd48bf2240a18ec324de4fd37cb27 (patch)
tree7e3a066c1d3dab26c83129720740e8344543d624 /sys/vm/vm_object.c
parent1739e5021692bfaef8f06397985c7f7606a38e0d (diff)
downloadFreeBSD-src-a73af1b81d7cd48bf2240a18ec324de4fd37cb27.zip
FreeBSD-src-a73af1b81d7cd48bf2240a18ec324de4fd37cb27.tar.gz
Don't allow pagedaemon to skip pages while scanning PQ_ACTIVE or PQ_INACTIVE
due to the vm object being locked. When a process writes large amounts of data to a file, the vm object associated with that file can contain most of the physical pages on the machine. If the process is preempted while holding the lock on the vm object, pagedaemon would be able to move very few pages from PQ_INACTIVE to PQ_CACHE or from PQ_ACTIVE to PQ_INACTIVE, resulting in unlimited cleaning of dirty pages belonging to other vm objects. Temporarily unlock the page queues lock while locking vm objects to avoid lock order violation. Detect and handle relevant page queue changes. This change depends on both the lock portion of struct vm_object and normal struct vm_page being type stable. Reviewed by: alc
Diffstat (limited to 'sys/vm/vm_object.c')
-rw-r--r--sys/vm/vm_object.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index 213501c..949ffda 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -250,6 +250,11 @@ vm_object_init(void)
_vm_object_allocate(OBJT_DEFAULT, OFF_TO_IDX(VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS),
kmem_object);
+ /*
+ * The lock portion of struct vm_object must be type stable due
+ * to vm_pageout_fallback_object_lock locking a vm object
+ * without holding any references to it.
+ */
obj_zone = uma_zcreate("VM OBJECT", sizeof (struct vm_object), NULL,
#ifdef INVARIANTS
vm_object_zdtor,
OpenPOWER on IntegriCloud