mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 09:14:47 +08:00
fix: usm reuse, clean from largest
When trimming old allocations in usm reuse start from largest allocations. This will reduce memory usage more quickly once max hold time is hit. Related-To: NEO-6893, NEO-14429 Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
cc308719d8
commit
bd516b3552
@@ -165,6 +165,12 @@ class SVMAllocsManager {
|
||||
bool operator<(size_t const &size) const {
|
||||
return allocationSize < size;
|
||||
}
|
||||
void markForDelete() {
|
||||
allocationSize = 0u;
|
||||
}
|
||||
static bool isMarkedForDelete(SvmCacheAllocationInfo const &info) {
|
||||
return 0 == info.allocationSize;
|
||||
}
|
||||
};
|
||||
|
||||
struct SvmAllocationCache {
|
||||
@@ -195,7 +201,7 @@ class SVMAllocsManager {
|
||||
bool isInUse(SvmAllocationData *svmData);
|
||||
void *get(size_t size, const UnifiedMemoryProperties &unifiedMemoryProperties);
|
||||
void trim();
|
||||
void trimOldAllocs(std::chrono::high_resolution_clock::time_point trimTimePoint, bool shouldLimitReuse);
|
||||
void trimOldAllocs(std::chrono::high_resolution_clock::time_point trimTimePoint, bool trimAll);
|
||||
void cleanup();
|
||||
void logCacheOperation(const SvmAllocationCachePerfInfo &cachePerfEvent) const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user