Lines Matching defs:mem
876 * Inserts the given mem entry into the object/object-page
883 vm_page_t mem,
887 vm_page_insert_internal(mem, object, offset, FALSE);
893 vm_page_t mem,
902 (integer_t)object, (integer_t)offset, (integer_t)mem, 0,0);
904 VM_PAGE_CHECK(mem);
913 if (mem->tabled || mem->object != VM_OBJECT_NULL)
916 mem, object, offset, mem->object, mem->offset);
922 assert(object->pageout == mem->pageout);
930 mem->object = object;
931 mem->offset = offset;
939 mem->next = bucket->pages;
940 bucket->pages = mem;
951 VM_PAGE_INSERT(mem, object);
952 mem->tabled = TRUE;
969 mem->throttled) {
972 vm_page_deactivate(mem);
989 register vm_page_t mem,
996 VM_PAGE_CHECK(mem);
1001 if (mem->tabled || mem->object != VM_OBJECT_NULL)
1004 mem, object, offset, mem->object, mem->offset);
1010 mem->object = object;
1011 mem->offset = offset;
1038 mem->next = bucket->pages;
1040 mem->next = VM_PAGE_NULL;
1045 bucket->pages = mem;
1077 VM_PAGE_INSERT(mem, object);
1078 mem->tabled = TRUE;
1090 if (mem->throttled) {
1091 vm_page_deactivate(mem);
1099 * Removes the given mem entry from the object/offset-page
1107 register vm_page_t mem)
1114 (integer_t)mem->object, (integer_t)mem->offset,
1115 (integer_t)mem, 0,0);
1119 vm_object_lock_assert_exclusive(mem->object);
1120 assert(mem->tabled);
1121 assert(!mem->cleaning);
1122 VM_PAGE_CHECK(mem);
1129 bucket = &vm_page_buckets[vm_page_hash(mem->object, mem->offset)];
1131 if ((this = bucket->pages) == mem) {
1134 bucket->pages = mem->next;
1139 (this = *prev) != mem;
1153 VM_PAGE_REMOVE(mem);
1160 mem->object->resident_page_count--;
1162 if (mem->object->purgable == VM_PURGABLE_VOLATILE) {
1166 mem->tabled = FALSE;
1167 mem->object = VM_OBJECT_NULL;
1168 mem->offset = (vm_object_offset_t) -1;
1193 register vm_page_t mem;
1198 mem = object->memq_hint;
1200 if (mem != VM_PAGE_NULL) {
1201 assert(mem->object == object);
1203 if (mem->offset == offset) {
1205 return mem;
1207 qe = queue_next(&mem->listq);
1221 qe = queue_prev(&mem->listq);
1256 for (mem = bucket->pages; mem != VM_PAGE_NULL; mem = mem->next) {
1257 VM_PAGE_CHECK(mem);
1258 if ((mem->object == object) && (mem->offset == offset))
1263 if (mem != VM_PAGE_NULL) {
1267 assert(mem->object == object);
1268 object->memq_hint = mem;
1272 return(mem);
1286 register vm_page_t mem,
1291 assert(mem->object != new_object);
1306 if (!encrypted_ok && mem->encrypted) {
1307 panic("vm_page_rename: page %p is encrypted\n", mem);
1311 * Changes to mem->object require the page lock because
1318 (integer_t)mem, 0,0);
1321 vm_page_remove(mem);
1322 vm_page_insert(mem, new_object, new_offset);
1335 vm_page_t mem,
1339 *mem = vm_page_template;
1340 mem->phys_page = phys_page;
1539 register vm_page_t mem;
1549 mem,
1552 assert(mem->free);
1553 assert(mem->busy);
1554 assert(!mem->pmapped);
1555 assert(!mem->wpmapped);
1557 mem->pageq.next = NULL;
1558 mem->pageq.prev = NULL;
1559 mem->free = FALSE;
1566 mem = VM_PAGE_NULL;
1570 return (mem);
1601 vm_page_t mem;
1606 if ((mem = PROCESSOR_DATA(current_processor(), free_pages))) {
1609 PROCESSOR_DATA(current_processor(), free_pages) = mem->pageq.next;
1610 mem->pageq.next = NULL;
1614 assert(mem->listq.next == NULL && mem->listq.prev == NULL);
1615 assert(mem->tabled == FALSE);
1616 assert(mem->object == VM_OBJECT_NULL);
1617 assert(!mem->laundry);
1618 assert(!mem->free);
1619 assert(pmap_verify_free(mem->phys_page));
1620 assert(mem->busy);
1621 assert(!mem->encrypted);
1622 assert(!mem->pmapped);
1623 assert(!mem->wpmapped);
1625 return mem;
1656 mem = VM_PAGE_NULL;
1679 if ((mem = PROCESSOR_DATA(current_processor(), free_pages))) {
1707 mem,
1710 mem->pageq.next = NULL;
1711 mem->pageq.prev = NULL;
1716 head = mem;
1718 tail->pageq.next = (queue_t)mem;
1719 tail = mem;
1721 mem->pageq.prev = NULL;
1722 assert(mem->listq.next == NULL && mem->listq.prev == NULL);
1723 assert(mem->tabled == FALSE);
1724 assert(mem->object == VM_OBJECT_NULL);
1725 assert(!mem->laundry);
1726 assert(mem->free);
1727 mem->free = FALSE;
1729 assert(pmap_verify_free(mem->phys_page));
1730 assert(mem->busy);
1731 assert(!mem->free);
1732 assert(!mem->encrypted);
1733 assert(!mem->pmapped);
1734 assert(!mem->wpmapped);
1743 mem = head;
1744 mem->pageq.next = NULL;
1784 // dbgLog(mem->phys_page, vm_page_free_count, vm_page_wire_count, 4); /* (TEST/DEBUG) */
1786 return mem;
1797 register vm_page_t mem)
1804 physent = mapping_phys_lookup(mem->phys_page, &pindex); /* (BRINGUP) */
1806 panic("vm_page_release: already released - %08X %08X\n", mem, mem->phys_page);
1810 assert(!mem->private && !mem->fictitious);
1812 // dbgLog(mem->phys_page, vm_page_free_count, vm_page_wire_count, 5); /* (TEST/DEBUG) */
1816 if (mem->free)
1819 mem->free = TRUE;
1821 assert(mem->busy);
1822 assert(!mem->laundry);
1823 assert(mem->object == VM_OBJECT_NULL);
1824 assert(mem->pageq.next == NULL &&
1825 mem->pageq.prev == NULL);
1826 assert(mem->listq.next == NULL &&
1827 mem->listq.prev == NULL);
1829 if (mem->phys_page <= vm_lopage_poolend && mem->phys_page >= vm_lopage_poolstart) {
1836 mem,
1841 color = mem->phys_page & vm_color_mask;
1843 mem,
1972 register vm_page_t mem;
1975 mem = vm_page_grab();
1976 if (mem == VM_PAGE_NULL)
1979 vm_page_insert(mem, object, offset);
1981 return(mem);
1989 register vm_page_t mem;
1992 mem = vm_page_grablo();
1993 if (mem == VM_PAGE_NULL)
1996 vm_page_insert(mem, object, offset);
1998 return(mem);
2015 register vm_page_t mem;
2018 mem = vm_page_grab_guard();
2019 if (mem == VM_PAGE_NULL)
2022 vm_page_insert(mem, object, offset);
2024 return(mem);
2041 register vm_page_t mem)
2043 VM_PAGE_CHECK(mem);
2044 assert(!mem->free);
2045 assert(!mem->cleaning);
2046 assert(!mem->pageout);
2049 if (vm_page_free_verify && !mem->fictitious && !mem->private) {
2050 assert(pmap_verify_free(mem->phys_page));
2052 if (mem->object)
2053 vm_object_lock_assert_exclusive(mem->object);
2056 if (mem->free)
2060 if (mem->laundry) {
2068 vm_pageout_throttle_up(mem);
2072 if (mem->tabled)
2073 vm_page_remove(mem); /* clears tabled, object, offset */
2075 VM_PAGE_QUEUES_REMOVE(mem); /* clears active/inactive/throttled/speculative */
2077 if (mem->wire_count) {
2078 if (!mem->private && !mem->fictitious)
2080 mem->wire_count = 0;
2081 assert(!mem->gobbled);
2082 } else if (mem->gobbled) {
2083 if (!mem->private && !mem->fictitious)
2087 mem->gobbled = FALSE;
2089 PAGE_WAKEUP(mem); /* clears wanted */
2092 mem->busy = TRUE;
2093 mem->absent = FALSE;
2094 mem->error = FALSE;
2095 mem->dirty = FALSE;
2096 mem->precious = FALSE;
2097 mem->reference = FALSE;
2098 mem->encrypted = FALSE;
2099 mem->encrypted_cleaning = FALSE;
2100 mem->deactivated = FALSE;
2101 mem->pmapped = FALSE;
2102 mem->wpmapped = FALSE;
2104 if (mem->private) {
2105 mem->private = FALSE;
2106 mem->fictitious = TRUE;
2107 mem->phys_page = vm_page_fictitious_addr;
2109 if (!mem->fictitious) {
2110 if (mem->zero_fill == TRUE) {
2111 mem->zero_fill = FALSE;
2114 vm_page_init(mem, mem->phys_page);
2120 vm_page_t mem)
2122 vm_page_free_prepare(mem);
2123 if (mem->fictitious) {
2124 vm_page_release_fictitious(mem);
2126 vm_page_release(mem);
2141 vm_page_t mem)
2158 while (mem) {
2160 if (mem->tabled || mem->object)
2162 if (mem->inactive || mem->active || mem->throttled || mem->free)
2164 if (vm_page_free_verify && !mem->fictitious && !mem->private) {
2165 assert(pmap_verify_free(mem->phys_page));
2168 assert(mem->pageq.prev == NULL);
2169 assert(mem->busy);
2170 assert(!mem->free);
2171 nxt = (vm_page_t)(mem->pageq.next);
2173 if (!mem->fictitious) {
2174 if (mem->phys_page <= vm_lopage_poolend && mem->phys_page >= vm_lopage_poolstart) {
2175 mem->pageq.next = NULL;
2176 vm_page_release(mem);
2178 mem->free = TRUE;
2180 color = mem->phys_page & vm_color_mask;
2186 mem,
2192 assert(mem->phys_page == vm_page_fictitious_addr ||
2193 mem->phys_page == vm_page_guard_addr);
2194 vm_page_release_fictitious(mem);
2196 mem = nxt;
2294 register vm_page_t mem)
2297 // dbgLog(current_thread(), mem->offset, mem->object, 1); /* (TEST/DEBUG) */
2299 VM_PAGE_CHECK(mem);
2301 if (mem->object)
2302 vm_object_lock_assert_exclusive(mem->object);
2305 if (mem->wire_count == 0) {
2306 VM_PAGE_QUEUES_REMOVE(mem);
2307 if (!mem->private && !mem->fictitious && !mem->gobbled)
2309 if (mem->gobbled)
2311 mem->gobbled = FALSE;
2312 if (mem->zero_fill == TRUE) {
2313 mem->zero_fill = FALSE;
2344 assert(!mem->gobbled);
2345 mem->wire_count++;
2357 register vm_page_t mem)
2360 VM_PAGE_CHECK(mem);
2362 assert(!mem->gobbled);
2363 assert(mem->wire_count == 0);
2365 if (!mem->gobbled && mem->wire_count == 0) {
2366 if (!mem->private && !mem->fictitious)
2370 mem->gobbled = TRUE;
2384 register vm_page_t mem)
2387 // dbgLog(current_thread(), mem->offset, mem->object, 0); /* (TEST/DEBUG) */
2389 VM_PAGE_CHECK(mem);
2390 assert(mem->wire_count > 0);
2392 if (mem->object)
2393 vm_object_lock_assert_exclusive(mem->object);
2396 if (--mem->wire_count == 0) {
2397 assert(!mem->private && !mem->fictitious);
2399 assert(!mem->laundry);
2400 assert(mem->object != kernel_object);
2401 assert(mem->pageq.next == NULL && mem->pageq.prev == NULL);
2402 if (mem->object->purgable == VM_PURGABLE_EMPTY) {
2403 vm_page_deactivate(mem);
2405 vm_page_activate(mem);