Changeset View
Changeset View
Standalone View
Standalone View
sys/vm/vm_object.c
| Show First 20 Lines • Show All 2,516 Lines • ▼ Show 20 Lines | if (obj->type == OBJT_DEAD || | ||||
| continue; | continue; | ||||
| VM_OBJECT_RLOCK(obj); | VM_OBJECT_RLOCK(obj); | ||||
| if (obj->type == OBJT_DEAD || | if (obj->type == OBJT_DEAD || | ||||
| (swap_only && (obj->flags & (OBJ_ANON | OBJ_SWAP)) == 0)) { | (swap_only && (obj->flags & (OBJ_ANON | OBJ_SWAP)) == 0)) { | ||||
| VM_OBJECT_RUNLOCK(obj); | VM_OBJECT_RUNLOCK(obj); | ||||
| continue; | continue; | ||||
| } | } | ||||
| mtx_unlock(&vm_object_list_mtx); | mtx_unlock(&vm_object_list_mtx); | ||||
| memset(kvo, 0, sizeof(*kvo)); | |||||
| kvo->kvo_size = ptoa(obj->size); | kvo->kvo_size = ptoa(obj->size); | ||||
| kvo->kvo_resident = obj->resident_page_count; | kvo->kvo_resident = obj->resident_page_count; | ||||
| kvo->kvo_ref_count = obj->ref_count; | kvo->kvo_ref_count = obj->ref_count; | ||||
| kvo->kvo_shadow_count = atomic_load_int(&obj->shadow_count); | kvo->kvo_shadow_count = atomic_load_int(&obj->shadow_count); | ||||
| kvo->kvo_memattr = obj->memattr; | kvo->kvo_memattr = obj->memattr; | ||||
| kvo->kvo_active = 0; | |||||
| kvo->kvo_inactive = 0; | |||||
| kvo->kvo_laundry = 0; | |||||
| kvo->kvo_flags = 0; | |||||
| if (!swap_only) { | if (!swap_only) { | ||||
| vm_page_iter_init(&pages, obj); | vm_page_iter_init(&pages, obj); | ||||
| VM_RADIX_FOREACH(m, &pages) { | VM_RADIX_FOREACH(m, &pages) { | ||||
| /* | /* | ||||
| * A page may belong to the object but be | * A page may belong to the object but be | ||||
| * dequeued and set to PQ_NONE while the | * dequeued and set to PQ_NONE while the | ||||
| * object lock is not held. This makes the | * object lock is not held. This makes the | ||||
| * reads of m->queue below racy, and we do not | * reads of m->queue below racy, and we do not | ||||
| * count pages set to PQ_NONE. However, this | * count pages set to PQ_NONE. However, this | ||||
| * sysctl is only meant to give an | * sysctl is only meant to give an | ||||
| * approximation of the system anyway. | * approximation of the system anyway. | ||||
| */ | */ | ||||
| if (vm_page_active(m)) | if (vm_page_active(m)) | ||||
| kvo->kvo_active++; | kvo->kvo_active++; | ||||
| else if (vm_page_inactive(m)) | else if (vm_page_inactive(m)) | ||||
| kvo->kvo_inactive++; | kvo->kvo_inactive++; | ||||
| else if (vm_page_in_laundry(m)) | else if (vm_page_in_laundry(m)) | ||||
| kvo->kvo_laundry++; | kvo->kvo_laundry++; | ||||
| } | } | ||||
| } | } | ||||
| kvo->kvo_vn_fileid = 0; | |||||
| kvo->kvo_vn_fsid = 0; | |||||
| kvo->kvo_vn_fsid_freebsd11 = 0; | |||||
| freepath = NULL; | freepath = NULL; | ||||
| fullpath = ""; | fullpath = ""; | ||||
| vp = NULL; | vp = NULL; | ||||
| kvo->kvo_type = vm_object_kvme_type(obj, want_path ? &vp : | kvo->kvo_type = vm_object_kvme_type(obj, want_path ? &vp : | ||||
| NULL); | NULL); | ||||
| if (vp != NULL) { | if (vp != NULL) { | ||||
| vref(vp); | vref(vp); | ||||
| } else if ((obj->flags & OBJ_ANON) != 0) { | } else if ((obj->flags & OBJ_ANON) != 0) { | ||||
| ▲ Show 20 Lines • Show All 283 Lines • Show Last 20 Lines | |||||