performance: Stop direct submission before removing host ptrs

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk
2024-05-07 11:59:43 +00:00
committed by Compute-Runtime-Automation
parent 34cfba4a2a
commit 4fd219cdbb
9 changed files with 133 additions and 2 deletions

View File

@@ -358,6 +358,9 @@ class CommandStreamReceiver {
virtual void stopDirectSubmission(bool blocking) {}
virtual void stopDirectSubmissionForHostptrDestroy() {}
virtual void startDirectSubmissionForHostptrDestroy() {}
virtual QueueThrottle getLastDirectSubmissionThrottle() = 0;
bool isStaticWorkPartitioningEnabled() const {

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2023 Intel Corporation
* Copyright (C) 2018-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -39,7 +39,16 @@ void InternalAllocationStorage::storeAllocationWithTaskCount(std::unique_ptr<Gra
}
void InternalAllocationStorage::cleanAllocationList(TaskCountType waitTaskCount, uint32_t allocationUsage) {
bool restartDirectSubmission = allocationUsage == TEMPORARY_ALLOCATION && !allocationLists[allocationUsage].peekIsEmpty();
if (restartDirectSubmission) {
this->commandStreamReceiver.stopDirectSubmissionForHostptrDestroy();
}
freeAllocationsList(waitTaskCount, allocationLists[allocationUsage]);
if (restartDirectSubmission) {
this->commandStreamReceiver.startDirectSubmissionForHostptrDestroy();
}
}
void InternalAllocationStorage::freeAllocationsList(TaskCountType waitTaskCount, AllocationsList &allocationsList) {

View File

@@ -31,6 +31,9 @@ class WddmCommandStreamReceiver : public DeviceCommandStreamReceiver<GfxFamily>
bool waitForFlushStamp(FlushStamp &flushStampToWait) override;
bool isTlbFlushRequiredForStateCacheFlush() override;
void stopDirectSubmissionForHostptrDestroy() override;
void startDirectSubmissionForHostptrDestroy() override;
WddmMemoryManager *getMemoryManager() const;
Wddm *peekWddm() const {
return wddm;

View File

@@ -157,6 +157,20 @@ bool WddmCommandStreamReceiver<GfxFamily>::waitForFlushStamp(FlushStamp &flushSt
return wddm->waitFromCpu(flushStampToWait, static_cast<OsContextWin *>(this->osContext)->getResidencyController().getMonitoredFence(), false);
}
template <typename GfxFamily>
void WddmCommandStreamReceiver<GfxFamily>::stopDirectSubmissionForHostptrDestroy() {
auto lock = this->obtainUniqueOwnership();
this->stopDirectSubmission(false);
}
template <typename GfxFamily>
void WddmCommandStreamReceiver<GfxFamily>::startDirectSubmissionForHostptrDestroy() {
if (this->isAnyDirectSubmissionEnabled()) {
auto lock = this->obtainUniqueOwnership();
this->flushTagUpdate();
}
}
template <typename GfxFamily>
bool WddmCommandStreamReceiver<GfxFamily>::isTlbFlushRequiredForStateCacheFlush() {
return true;