performance: remove trim candidate list

Related-To: NEO-11755

Removing trim candidate list reduces overhead
caused by residency handling. Allocations required
for eviction are placed in eviction container managed
by CSR.

Signed-off-by: Szymon Morek <szymon.morek@intel.com>
This commit is contained in:
Szymon Morek
2024-08-22 10:25:49 +00:00
committed by Compute-Runtime-Automation
parent 6455d4648c
commit b8f181d50e
24 changed files with 184 additions and 599 deletions

View File

@@ -146,14 +146,12 @@ SubmissionStatus WddmCommandStreamReceiver<GfxFamily>::flush(BatchBuffer &batchB
}
template <typename GfxFamily>
SubmissionStatus WddmCommandStreamReceiver<GfxFamily>::processResidency(const ResidencyContainer &allocationsForResidency, uint32_t handleId) {
SubmissionStatus WddmCommandStreamReceiver<GfxFamily>::processResidency(ResidencyContainer &allocationsForResidency, uint32_t handleId) {
return static_cast<OsContextWin *>(this->osContext)->getResidencyController().makeResidentResidencyAllocations(allocationsForResidency, this->requiresBlockingResidencyHandling) ? SubmissionStatus::success : SubmissionStatus::outOfMemory;
}
template <typename GfxFamily>
void WddmCommandStreamReceiver<GfxFamily>::processEviction() {
static_cast<OsContextWin *>(this->osContext)->getResidencyController().makeNonResidentEvictionAllocations(this->getEvictionAllocations());
this->getEvictionAllocations().clear();
}
template <typename GfxFamily>
@@ -217,4 +215,17 @@ CommandStreamReceiver *createWddmDeviceCommandStreamReceiver(bool withAubDump,
}
}
template <typename GfxFamily>
void WddmCommandStreamReceiver<GfxFamily>::setupContext(OsContext &osContext) {
this->osContext = &osContext;
static_cast<OsContextWin *>(this->osContext)->getResidencyController().setCommandStreamReceiver(this);
}
template <typename GfxFamily>
void WddmCommandStreamReceiver<GfxFamily>::addToEvictionContainer(GraphicsAllocation &gfxAllocation) {
// Eviction allocations are shared with trim callback thread.
auto lock = static_cast<OsContextWin *>(this->osContext)->getResidencyController().acquireLock();
this->getEvictionAllocations().push_back(&gfxAllocation);
}
} // namespace NEO