From 02094caa2c2fce94821d84bde50b9373b47f97e7 Mon Sep 17 00:00:00 2001 From: alc Date: Sun, 9 Dec 2012 00:32:38 +0000 Subject: In the past four years, we've added two new vm object types. Each time, similar changes had to be made in various places throughout the machine- independent virtual memory layer to support the new vm object type. However, in most of these places, it's actually not the type of the vm object that matters to us but instead certain attributes of its pages. For example, OBJT_DEVICE, OBJT_MGTDEVICE, and OBJT_SG objects contain fictitious pages. In other words, in most of these places, we were testing the vm object's type to determine if it contained fictitious (or unmanaged) pages. To both simplify the code in these places and make the addition of future vm object types easier, this change introduces two new vm object flags that describe attributes of the vm object's pages, specifically, whether they are fictitious or unmanaged. Reviewed and tested by: kib --- sys/vm/vm_pageout.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/vm/vm_pageout.c') diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index 610f6e0..b5e9747 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -705,14 +705,14 @@ vm_pageout_object_deactivate_pages(pmap_t pmap, vm_object_t first_object, int actcount, remove_mode; VM_OBJECT_LOCK_ASSERT(first_object, MA_OWNED); - if (first_object->type == OBJT_DEVICE || - first_object->type == OBJT_SG) + if ((first_object->flags & OBJ_FICTITIOUS) != 0) return; for (object = first_object;; object = backing_object) { if (pmap_resident_count(pmap) <= desired) goto unlock_return; VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - if (object->type == OBJT_PHYS || object->paging_in_progress) + if ((object->flags & OBJ_UNMANAGED) != 0 || + object->paging_in_progress != 0) goto unlock_return; remove_mode = 0; -- cgit v1.1