Lines Matching refs:cache

41 #include "../cache/vnode_store.h"
82 VMCacheTraceEntry(VMCache* cache)
84 fCache(cache)
116 Create(VMCache* cache)
118 VMCacheTraceEntry(cache)
125 out.Print("vm cache create: -> cache: %p", fCache);
132 Delete(VMCache* cache)
134 VMCacheTraceEntry(cache)
141 out.Print("vm cache delete: cache: %p", fCache);
148 SetMinimalCommitment(VMCache* cache, off_t commitment)
150 VMCacheTraceEntry(cache),
151 fOldCommitment(cache->committed_size),
159 out.Print("vm cache set min commitment: cache: %p, "
172 Resize(VMCache* cache, off_t size)
174 VMCacheTraceEntry(cache),
175 fOldSize(cache->virtual_end),
183 out.Print("vm cache resize: cache: %p, size: %" B_PRIdOFF " -> %"
195 Rebase(VMCache* cache, off_t base)
197 VMCacheTraceEntry(cache),
198 fOldBase(cache->virtual_base),
206 out.Print("vm cache rebase: cache: %p, base: %lld -> %lld", fCache,
218 AddConsumer(VMCache* cache, VMCache* consumer)
220 VMCacheTraceEntry(cache),
228 out.Print("vm cache add consumer: cache: %p, consumer: %p", fCache,
244 RemoveConsumer(VMCache* cache, VMCache* consumer)
246 VMCacheTraceEntry(cache),
254 out.Print("vm cache remove consumer: cache: %p, consumer: %p",
265 Merge(VMCache* cache, VMCache* consumer)
267 VMCacheTraceEntry(cache),
275 out.Print("vm cache merge with consumer: cache: %p, consumer: %p",
286 InsertArea(VMCache* cache, VMArea* area)
288 VMCacheTraceEntry(cache),
296 out.Print("vm cache insert area: cache: %p, area: %p", fCache,
312 RemoveArea(VMCache* cache, VMArea* area)
314 VMCacheTraceEntry(cache),
322 out.Print("vm cache remove area: cache: %p, area: %p", fCache,
340 InsertPage(VMCache* cache, vm_page* page, off_t offset)
342 VMCacheTraceEntry(cache),
351 out.Print("vm cache insert page: cache: %p, page: %p, offset: %"
363 RemovePage(VMCache* cache, vm_page* page)
365 VMCacheTraceEntry(cache),
373 out.Print("vm cache remove page: cache: %p, page: %p", fCache,
421 cache_stack_find_consumer(const TraceEntryIterator& baseIterator, void* cache)
425 // find the previous "add consumer" or "create" entry for the given cache
430 if (createEntry->Cache() == cache)
433 if (addEntry->Consumer() == cache)
480 kprintf("cache stack for %s %p at %" B_PRIu64 ":\n",
481 isArea ? "area" : "cache", address, debugEntryIndex);
485 kprintf(" cache not found\n");
509 gCacheRefObjectCache = create_object_cache("cache refs", sizeof(VMCacheRef),
551 "address is an area instead of a cache address. The listing will\n"
552 "start with the area's cache at that point.\n",
570 VMCache* cache = cacheRef->cache;
571 if (!cache->TryLock()) {
578 cache->AcquireRefLocked();
579 return cache;
582 // the cache changed in the meantime
583 cache->Unlock();
593 VMCache* cache = cacheRef->cache;
594 if (!cache->SwitchLock(&sCacheListLock)) {
595 // cache has been deleted
601 if (cache == page->Cache()) {
603 cache->AcquireRefLocked();
604 return cache;
607 // the cache changed in the meantime
608 cache->Unlock();
616 VMCacheRef::VMCacheRef(VMCache* cache)
618 cache(cache),
694 panic("cache %p to be deleted still has areas", this);
696 panic("cache %p to be deleted still has consumers", this);
700 // free all of the pages in the cache
703 panic("remove page %p from cache %p: page still has mappings!\n"
704 "@!page %p; cache %p", page, this, page, this);
754 // Someone else has locked the consumer ATM. Unlock this cache and
755 // wait for the consumer lock. Increment the cache's ref count
757 // delete the cache.
776 // delete this cache
792 panic("page %p not in cache %p\n", page, this);
802 TRACE(("VMCache::InsertPage(): cache %p, page %p, offset %" B_PRIdOFF "\n",
807 panic("insert page %p into cache %p: page cache is set to %p\n",
820 panic("VMCache::InsertPage(): there's already page %p with cache "
821 "offset %" B_PRIuPHYSADDR " in cache %p; inserting page %p",
833 /*! Removes the vm_page from this cache. Of course, the page must
834 really be in this cache or evil things will happen.
835 The cache lock must be held.
840 TRACE(("VMCache::RemovePage(): cache %p, page %p\n", this, page));
844 panic("remove page %p from cache %p: page cache is set to %p\n", page,
859 /*! Moves the given page from its current cache inserts it into this cache
871 // remove from old cache
892 /*! Moves the given page from its current cache inserts it into this cache.
902 /*! Moves all pages from the given cache to this one.
903 Both caches must be locked. This cache must be empty.
921 fCacheRef->cache = this;
922 fromCache->fCacheRef->cache = fromCache;
936 this cache.
937 The cache must be locked. It will be unlocked by the method. \a relock
938 specifies whether the method shall re-lock the cache before returning.
941 \param relock If \c true, the cache will be locked when returning,
965 /*! Makes this case the source of the \a consumer cache,
967 This also grabs a reference to the source cache.
968 Assumes you have the cache and the consumer's lock held.
973 TRACE(("add consumer vm cache %p to cache %p\n", consumer, this));
987 /*! Adds the \a area to this cache.
988 Assumes you have the locked the cache.
993 TRACE(("VMCache::InsertAreaLocked(cache %p, area %p)\n", this, area));
1013 TRACE(("VMCache::RemoveArea(cache %p, area %p)\n", this, area));
1036 /*! Transfers the areas from \a fromCache to this cache. This cache must not
1050 area->cache = this;
1079 TRACE(("VMCache::WriteModified(cache = %p)\n", this));
1094 Assumes you have the cache's lock held.
1099 TRACE(("VMCache::SetMinimalCommitment(cache %p, commitment %" B_PRIdOFF
1110 // ToDo: should we check if the cache's virtual size is large
1161 /*! This function updates the size field of the cache.
1162 If needed, it will free up all pages that don't belong to the cache anymore.
1163 The cache lock must be held when you call it.
1164 Since removed pages don't belong to the cache any longer, they are not
1167 Note, this function may temporarily release the cache lock in case it
1173 TRACE(("VMCache::Resize(cache %p, newSize %" B_PRIdOFF ") old size %"
1189 // we need to remove all pages in the cache outside of the new virtual
1199 /*! This function updates the virtual_base field of the cache.
1200 If needed, it will free up all pages that don't belong to the cache anymore.
1201 The cache lock must be held when you call it.
1202 Since removed pages don't belong to the cache any longer, they are not
1205 Note, this function may temporarily release the cache lock in case it
1211 TRACE(("VMCache::Rebase(cache %p, newBase %lld) old base %lld\n",
1224 // we need to remove all pages in the cache outside of the new virtual
1235 /*! Moves pages in the given range from the source cache into this cache. Both
1323 /*! Returns whether the cache's underlying backing store could deliver the
1370 /*! \brief Returns whether the cache can write the page at the given offset.
1372 The cache must be locked when this function is invoked.
1401 // the page is not yet in the consumer cache - move it upwards
1494 kprintf("\t%" B_PRIu32 " in cache\n", page_count);
1517 /*! Merges the given cache with its only consumer.
1518 The caller must hold both the cache's and the consumer's lock. The method
1526 TRACE(("merge vm cache %p (ref == %" B_PRId32 ") with vm cache %p\n",
1531 // merge the cache
1549 // Release the reference the cache's consumer owned. The consumer takes
1550 // over the cache's ref to its source (if any) instead.
1555 /*! Removes the \a consumer from this cache.
1556 It will also release the reference to the cache owned by the consumer.
1557 Assumes you have the consumer's cache lock held. This cache must not be
1563 TRACE(("remove consumer vm cache %p from cache %p\n", consumer, this));
1568 // Remove the store ref before locking the cache. Otherwise we'd call into
1569 // the VFS while holding the cache lock, which would reverse the usual
1573 // remove the consumer from the cache, but keep its reference until later
1598 VMAnonymousCache* cache
1600 if (cache == NULL)
1603 status_t error = cache->Init(canOvercommit, numPrecommittedPages,
1606 cache->Delete();
1610 T(Create(cache));
1612 _cache = cache;
1617 VMAnonymousNoSwapCache* cache
1620 if (cache == NULL)
1623 status_t error = cache->Init(canOvercommit, numPrecommittedPages,
1626 cache->Delete();
1630 T(Create(cache));
1632 _cache = cache;
1642 // Note: Vnode cache creation is never VIP.
1644 VMVnodeCache* cache
1646 if (cache == NULL)
1649 status_t error = cache->Init(vnode, allocationFlags);
1651 cache->Delete();
1655 T(Create(cache));
1657 _cache = cache;
1667 // Note: Device cache creation is never VIP.
1669 VMDeviceCache* cache
1671 if (cache == NULL)
1674 status_t error = cache->Init(baseAddress, allocationFlags);
1676 cache->Delete();
1680 T(Create(cache));
1682 _cache = cache;
1695 VMNullCache* cache
1697 if (cache == NULL)
1700 status_t error = cache->Init(allocationFlags);
1702 cache->Delete();
1706 T(Create(cache));
1708 _cache = cache;