Lines Matching defs:object

89  * Computes the index of the small page underlying the given (object, pindex)
92 #define VM_RESERV_INDEX(object, pindex) \
93 (((object)->pg_color + (pindex)) & (VM_LEVEL_0_NPAGES - 1))
154 * speculatively allocated to an object. The reservation provides the small
156 * within that object. The reservation's "popcnt" tracks the number of these
160 * object's list of reservations.
167 vm_object_t object; /* containing object */
168 vm_pindex_t pindex; /* offset within object */
192 * "object" field and a non-zero "popcnt" field. In other words, every active
193 * reservation belongs to a particular object. Moreover, every active
194 * reservation has an entry in the containing object's list of reservations.
314 KASSERT(rv->object != NULL,
334 rv->object = NULL;
375 KASSERT(rv->object != NULL,
407 * The object and free page queue must be locked.
410 vm_reserv_alloc_contig(vm_object_t object, vm_pindex_t pindex, u_long npages,
421 VM_OBJECT_ASSERT_WLOCKED(object);
427 if (pindex < VM_RESERV_INDEX(object, pindex) ||
428 pindex + npages > object->size)
441 pa = VM_RESERV_INDEX(object, pindex) << PAGE_SHIFT;
451 mpred = vm_radix_lookup_le(&object->rtree, pindex);
456 if (rv->object == object && vm_reserv_has_pindex(rv, pindex))
460 msucc = TAILQ_FIRST(&object->memq);
465 if (rv->object == object && vm_reserv_has_pindex(rv, pindex))
474 first = pindex - VM_RESERV_INDEX(object, pindex);
476 if ((rv = vm_reserv_from_page(mpred))->object != object)
483 minpages = VM_RESERV_INDEX(object, pindex) + npages;
487 if ((rv = vm_reserv_from_page(msucc))->object != object)
506 * Would the last new reservation extend past the end of the object?
508 if (first + maxpages > object->size) {
510 * Don't allocate the last new reservation if the object is a
511 * vnode or backed by another object that is a vnode.
513 if (object->type == OBJT_VNODE ||
514 (object->backing_object != NULL &&
515 object->backing_object->type == OBJT_VNODE)) {
520 /* Speculate that the object may grow. */
542 index = VM_RESERV_INDEX(object, pindex);
548 KASSERT(rv->object == NULL,
550 LIST_INSERT_HEAD(&object->rvq, rv, objq);
551 rv->object = object;
581 index = VM_RESERV_INDEX(object, pindex);
603 * specified object.
605 * The object and free page queue must be locked.
608 vm_reserv_alloc_page(vm_object_t object, vm_pindex_t pindex, vm_page_t mpred)
616 VM_OBJECT_ASSERT_WLOCKED(object);
621 if (pindex < VM_RESERV_INDEX(object, pindex) ||
622 pindex >= object->size)
629 KASSERT(mpred->object == object,
630 ("vm_reserv_alloc_page: object doesn't contain mpred"));
634 if (rv->object == object && vm_reserv_has_pindex(rv, pindex))
638 msucc = TAILQ_FIRST(&object->memq);
643 if (rv->object == object && vm_reserv_has_pindex(rv, pindex))
651 first = pindex - VM_RESERV_INDEX(object, pindex);
653 if ((rv = vm_reserv_from_page(mpred))->object != object)
661 if ((rv = vm_reserv_from_page(msucc))->object != object)
670 * Would a new reservation extend past the end of the object?
672 if (first + VM_LEVEL_0_NPAGES > object->size) {
674 * Don't allocate a new reservation if the object is a vnode or
675 * backed by another object that is a vnode.
677 if (object->type == OBJT_VNODE ||
678 (object->backing_object != NULL &&
679 object->backing_object->type == OBJT_VNODE))
681 /* Speculate that the object may grow. */
693 KASSERT(rv->object == NULL,
695 LIST_INSERT_HEAD(&object->rvq, rv, objq);
696 rv->object = object;
706 index = VM_RESERV_INDEX(object, pindex);
714 index = VM_RESERV_INDEX(object, pindex);
738 KASSERT(rv->object != NULL,
743 rv->object = NULL;
801 * Breaks all reservations belonging to the given object.
804 vm_reserv_break_all(vm_object_t object)
809 while ((rv = LIST_FIRST(&object->rvq)) != NULL) {
810 KASSERT(rv->object == object,
834 if (rv->object == NULL)
879 if (rv->object == NULL)
894 return (rv->object != NULL ? 0 : -1);
915 * containing "m" is allocated by the same object. Although "m" and the
916 * reservation belong to the same object, "m"'s pindex may not match the
929 if (rv->object == NULL)
933 if (m->object == rv->object &&
934 m->pindex - rv->pindex == (index = VM_RESERV_INDEX(m->object,
1083 * Transfers the reservation underlying the given page to a new object.
1085 * The object must be locked.
1095 if (rv->object == old_object) {
1097 if (rv->object == old_object) {
1100 rv->object = new_object;