Lines Matching full:region
29 // Region actually starts at a random offset from its base.
36 // The 1st Region (for size class 0) holds the TransferBatches. This is a
78 RegionInfo *Region = getRegionInfo(I); in initLinkerInitialized() local
79 // The actual start of a region is offseted by a random number of pages. in initLinkerInitialized()
80 Region->RegionBeg = in initLinkerInitialized()
82 Region->RandState = getRandomU32(&Seed); in initLinkerInitialized()
90 Region->CanRelease = (I != SizeClassMap::BatchClassId) && in initLinkerInitialized()
92 if (Region->CanRelease) in initLinkerInitialized()
93 Region->ReleaseInfo.LastReleaseAtNs = Time; in initLinkerInitialized()
111 RegionInfo *Region = getRegionInfo(ClassId); in popBatch() local
112 ScopedLock L(Region->Mutex); in popBatch()
113 TransferBatch *B = Region->FreeList.front(); in popBatch()
115 Region->FreeList.pop_front(); in popBatch()
117 B = populateFreeList(C, ClassId, Region); in popBatch()
122 Region->Stats.PoppedBlocks += B->getCount(); in popBatch()
128 RegionInfo *Region = getRegionInfo(ClassId); in pushBatch() local
129 ScopedLock L(Region->Mutex); in pushBatch()
130 Region->FreeList.push_front(B); in pushBatch()
131 Region->Stats.PushedBlocks += B->getCount(); in pushBatch()
132 if (Region->CanRelease) in pushBatch()
133 releaseToOSMaybe(Region, ClassId); in pushBatch()
159 const RegionInfo *Region = getRegionInfo(I); in iterateOverBlocks() local
161 const uptr From = Region->RegionBeg; in iterateOverBlocks()
162 const uptr To = From + Region->AllocatedUser; in iterateOverBlocks()
169 // TODO(kostyak): get the RSS per region. in getStats()
174 RegionInfo *Region = getRegionInfo(I); in getStats() local
175 if (Region->MappedUser) in getStats()
176 TotalMapped += Region->MappedUser; in getStats()
177 PoppedBlocks += Region->Stats.PoppedBlocks; in getStats()
178 PushedBlocks += Region->Stats.PushedBlocks; in getStats()
204 RegionInfo *Region = getRegionInfo(I); in releaseToOS() local
205 ScopedLock L(Region->Mutex); in releaseToOS()
206 TotalReleasedBytes += releaseToOSMaybe(Region, I, /*Force=*/true); in releaseToOS()
324 RegionInfo *Region) { in populateFreeList() argument
328 const uptr RegionBeg = Region->RegionBeg; in populateFreeList()
329 const uptr MappedUser = Region->MappedUser; in populateFreeList()
330 const uptr TotalUserBytes = Region->AllocatedUser + MaxCount * Size; in populateFreeList()
338 if (!Region->Exhausted) { in populateFreeList()
339 Region->Exhausted = true; in populateFreeList()
350 Region->Data = Data; in populateFreeList()
355 &Region->Data)) in populateFreeList()
357 Region->MappedUser += UserMapSize; in populateFreeList()
363 static_cast<u32>((Region->MappedUser - Region->AllocatedUser) / Size)); in populateFreeList()
371 uptr P = RegionBeg + Region->AllocatedUser; in populateFreeList()
376 shuffle(ShuffleArray, NumberOfBlocks, &Region->RandState); in populateFreeList()
383 Region->FreeList.push_back(B); in populateFreeList()
386 TransferBatch *B = Region->FreeList.front(); in populateFreeList()
387 Region->FreeList.pop_front(); in populateFreeList()
393 Region->AllocatedUser += AllocatedUser; in populateFreeList()
399 RegionInfo *Region = getRegionInfo(ClassId); in getStats() local
400 if (Region->MappedUser == 0) in getStats()
402 const uptr InUse = Region->Stats.PoppedBlocks - Region->Stats.PushedBlocks; in getStats()
403 const uptr TotalChunks = Region->AllocatedUser / getSizeByClassId(ClassId); in getStats()
406 "released: %6zuK region: 0x%zx (0x%zx)\n", in getStats()
407 Region->Exhausted ? "F" : " ", ClassId, in getStats()
408 getSizeByClassId(ClassId), Region->MappedUser >> 10, in getStats()
409 Region->Stats.PoppedBlocks, Region->Stats.PushedBlocks, InUse, in getStats()
410 TotalChunks, Rss >> 10, Region->ReleaseInfo.RangesReleased, in getStats()
411 Region->ReleaseInfo.LastReleasedBytes >> 10, Region->RegionBeg, in getStats()
415 NOINLINE uptr releaseToOSMaybe(RegionInfo *Region, uptr ClassId,
420 CHECK_GE(Region->Stats.PoppedBlocks, Region->Stats.PushedBlocks);
422 Region->AllocatedUser -
423 (Region->Stats.PoppedBlocks - Region->Stats.PushedBlocks) * BlockSize;
426 const uptr BytesPushed = (Region->Stats.PushedBlocks -
427 Region->ReleaseInfo.PushedBlocksAtLastRelease) *
436 if (!Force && BytesPushed < Region->AllocatedUser / 16U)
439 if ((BytesInFreeList * 100U) / Region->AllocatedUser <
448 if (Region->ReleaseInfo.LastReleaseAtNs +
456 ReleaseRecorder Recorder(Region->RegionBeg, &Region->Data);
457 releaseFreeMemoryToOS(Region->FreeList, Region->RegionBeg,
458 Region->AllocatedUser, 1U, BlockSize, &Recorder,
462 Region->ReleaseInfo.PushedBlocksAtLastRelease =
463 Region->Stats.PushedBlocks;
464 Region->ReleaseInfo.RangesReleased += Recorder.getReleasedRangesCount();
465 Region->ReleaseInfo.LastReleasedBytes = Recorder.getReleasedBytes();
467 Region->ReleaseInfo.LastReleaseAtNs = getMonotonicTime();