Lines Matching refs:page

71 	vm_page*			page;
340 InsertPage(VMCache* cache, vm_page* page, off_t offset)
343 fPage(page),
351 out.Print("vm cache insert page: cache: %p, page: %p, offset: %"
363 RemovePage(VMCache* cache, vm_page* page)
366 fPage(page)
373 out.Print("vm cache remove page: cache: %p, page: %p", fCache,
559 vm_cache_acquire_locked_page_cache(vm_page* page, bool dontWait)
564 VMCacheRef* cacheRef = page->CacheRef();
576 if (cacheRef == page->CacheRef()) {
587 VMCacheRef* cacheRef = page->CacheRef();
601 if (cache == page->Cache()) {
701 while (vm_page* page = pages.Root()) {
702 if (!page->mappings.IsEmpty() || page->WiredCount() != 0) {
703 panic("remove page %p from cache %p: page still has mappings!\n"
704 "@!page %p; cache %p", page, this, page, this);
708 pages.Remove(page);
709 page->SetCacheRef(NULL);
711 TRACE(("vm_cache_release_ref: freeing page 0x%lx\n",
712 page->physical_page_number));
713 DEBUG_PAGE_ACCESS_START(page);
714 vm_page_free(this, page);
788 vm_page* page = pages.Lookup((page_num_t)(offset >> PAGE_SHIFT));
791 if (page != NULL && page->Cache() != this)
792 panic("page %p not in cache %p\n", page, this);
795 return page;
800 VMCache::InsertPage(vm_page* page, off_t offset)
802 TRACE(("VMCache::InsertPage(): cache %p, page %p, offset %" B_PRIdOFF "\n",
803 this, page, offset));
806 if (page->CacheRef() != NULL) {
807 panic("insert page %p into cache %p: page cache is set to %p\n",
808 page, this, page->Cache());
811 T2(InsertPage(this, page, offset));
813 page->cache_offset = (page_num_t)(offset >> PAGE_SHIFT);
815 page->SetCacheRef(fCacheRef);
818 vm_page* otherPage = pages.Lookup(page->cache_offset);
820 panic("VMCache::InsertPage(): there's already page %p with cache "
821 "offset %" B_PRIuPHYSADDR " in cache %p; inserting page %p",
822 otherPage, page->cache_offset, this, page);
826 pages.Insert(page);
828 if (page->WiredCount() > 0)
833 /*! Removes the vm_page from this cache. Of course, the page must
838 VMCache::RemovePage(vm_page* page)
840 TRACE(("VMCache::RemovePage(): cache %p, page %p\n", this, page));
843 if (page->Cache() != this) {
844 panic("remove page %p from cache %p: page cache is set to %p\n", page,
845 this, page->Cache());
848 T2(RemovePage(this, page));
850 pages.Remove(page);
852 page->SetCacheRef(NULL);
854 if (page->WiredCount() > 0)
859 /*! Moves the given page from its current cache inserts it into this cache
864 VMCache::MovePage(vm_page* page, off_t offset)
866 VMCache* oldCache = page->Cache();
872 oldCache->pages.Remove(page);
874 T2(RemovePage(oldCache, page));
877 page->cache_offset = offset >> PAGE_SHIFT;
880 pages.Insert(page);
882 page->SetCacheRef(fCacheRef);
884 if (page->WiredCount() > 0) {
889 T2(InsertPage(this, page, page->cache_offset << PAGE_SHIFT));
892 /*! Moves the given page from its current cache inserts it into this cache.
896 VMCache::MovePage(vm_page* page)
898 MovePage(page, page->cache_offset << PAGE_SHIFT);
927 vm_page* page = it.Next();) {
928 T2(RemovePage(fromCache, page));
929 T2(InsertPage(this, page, page->cache_offset << PAGE_SHIFT));
935 /*! Waits until one or more events happened for a given page which belongs to
939 \param page The page for which to wait.
945 VMCache::WaitForPageEvents(vm_page* page, uint32 events, bool relock)
950 waiter.page = page;
955 thread_prepare_to_block(waiter.thread, 0, THREAD_BLOCK_TYPE_OTHER_OBJECT, page);
1125 for (vm_page* page = it.Next();
1126 page != NULL && (toPage == NULL || page->cache_offset < *toPage);
1127 page = it.Next()) {
1129 if (page->busy) {
1130 if (page->busy_writing) {
1131 // We cannot wait for the page to become available
1133 page->busy_writing = false;
1134 // this will notify the writer to free the page
1138 // wait for page to become unbusy
1139 WaitForPageEvents(page, PAGE_EVENT_NOT_BUSY, true);
1143 // remove the page and put it into the free queue
1144 DEBUG_PAGE_ACCESS_START(page);
1145 vm_remove_all_page_mappings(page);
1146 ASSERT(page->WiredCount() == 0);
1147 // TODO: Find a real solution! If the page is wired
1150 RemovePage(page);
1154 vm_page_free(this, page);
1247 for (vm_page* page = it.Next();
1248 page != NULL && page->cache_offset < endPage;
1249 page = it.Next()) {
1250 MovePage(page, (page->cache_offset << PAGE_SHIFT) + offsetChange);
1284 vm_page* page = it.Next();) {
1285 if (page->busy) {
1286 // wait for page to become unbusy
1287 WaitForPageEvents(page, PAGE_EVENT_NOT_BUSY, true);
1296 if (page->State() == PAGE_STATE_MODIFIED)
1300 if (page->IsMapped())
1303 DEBUG_PAGE_ACCESS_START(page);
1304 RemovePage(page);
1305 vm_page_free(this, page);
1324 page at the given offset.
1327 partial page (assuming that no unexpected errors occur or the situation
1370 /*! \brief Returns whether the cache can write the page at the given offset.
1374 @param offset The page offset.
1375 @return \c true, if the page can be written, \c false otherwise.
1395 vm_page* page = it.Next();) {
1399 (off_t)page->cache_offset << PAGE_SHIFT);
1401 // the page is not yet in the consumer cache - move it upwards
1402 MovePage(page);
1481 vm_page* page = it.Next();) {
1482 if (!vm_page_is_dummy(page)) {
1484 " state %u (%s) wired_count %u\n", page,
1485 page->physical_page_number, page->cache_offset,
1486 page->State(), page_state_to_string(page->State()),
1487 page->WiredCount());
1490 page, page->State(), page_state_to_string(page->State()));
1498 /*! Wakes up threads waiting for page events.
1499 \param page The page for which events occurred.
1503 VMCache::_NotifyPageEvents(vm_page* page, uint32 events)
1507 if (waiter->page == page && (waiter->events & events) != 0) {