Skip to content

Commit 7980465

Browse files
Remove not needed mutex from memory manager
Change-Id: Ia362b8fa400bcd2f97d779296af12e13e138792d Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
1 parent cd8f08b commit 7980465

File tree

2 files changed

+0
-7
lines changed

2 files changed

+0
-7
lines changed

runtime/memory_manager/memory_manager.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ GraphicsAllocation *MemoryManager::allocateGraphicsMemoryForSVM(size_t size, boo
115115
}
116116

117117
GraphicsAllocation *MemoryManager::allocateGraphicsMemory(size_t size, const void *ptr, bool forcePin) {
118-
std::lock_guard<decltype(mtx)> lock(mtx);
119118
if (deferredDeleter) {
120119
deferredDeleter->drain(true);
121120
}
@@ -148,17 +147,14 @@ void MemoryManager::freeSystemMemory(void *ptr) {
148147
}
149148

150149
void MemoryManager::storeAllocation(std::unique_ptr<GraphicsAllocation> gfxAllocation, uint32_t allocationUsage) {
151-
std::lock_guard<decltype(mtx)> lock(mtx);
152150
getCommandStreamReceiver(0)->getInternalAllocationStorage()->storeAllocation(std::move(gfxAllocation), allocationUsage);
153151
}
154152

155153
void MemoryManager::storeAllocation(std::unique_ptr<GraphicsAllocation> gfxAllocation, uint32_t allocationUsage, uint32_t taskCount) {
156-
std::lock_guard<decltype(mtx)> lock(mtx);
157154
getCommandStreamReceiver(0)->getInternalAllocationStorage()->storeAllocationWithTaskCount(std::move(gfxAllocation), allocationUsage, taskCount);
158155
}
159156

160157
std::unique_ptr<GraphicsAllocation> MemoryManager::obtainReusableAllocation(size_t requiredSize, bool internalAllocation) {
161-
std::lock_guard<decltype(mtx)> lock(mtx);
162158
return getCommandStreamReceiver(0)->getInternalAllocationStorage()->obtainReusableAllocation(requiredSize, internalAllocation);
163159
}
164160

@@ -186,13 +182,11 @@ void MemoryManager::applyCommonCleanup() {
186182
}
187183

188184
bool MemoryManager::cleanAllocationList(uint32_t waitTaskCount, uint32_t allocationUsage) {
189-
std::lock_guard<decltype(mtx)> lock(mtx);
190185
getCommandStreamReceiver(0)->getInternalAllocationStorage()->cleanAllocationsList(waitTaskCount, allocationUsage);
191186
return false;
192187
}
193188

194189
void MemoryManager::freeAllocationsList(uint32_t waitTaskCount, AllocationsList &allocationsList) {
195-
std::lock_guard<decltype(mtx)> lock(mtx);
196190
getCommandStreamReceiver(0)->getInternalAllocationStorage()->freeAllocationsList(waitTaskCount, allocationsList);
197191
}
198192

runtime/memory_manager/memory_manager.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,6 @@ class MemoryManager {
257257
const void *hostPtr, size_t size, GraphicsAllocation::AllocationType type);
258258

259259
GraphicsAllocation *allocateGraphicsMemory(const AllocationData &allocationData);
260-
std::recursive_mutex mtx;
261260
std::unique_ptr<TagAllocator<HwTimeStamps>> profilingTimeStampAllocator;
262261
std::unique_ptr<TagAllocator<HwPerfCounter>> perfCounterAllocator;
263262
std::unique_ptr<TagAllocator<TimestampPacket>> timestampPacketAllocator;

0 commit comments

Comments
 (0)