mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-30 01:35:20 +08:00
Revert "performance: don't wait immediately after VmBind"
This reverts commit 09118d2011.
Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
0ec361bbb9
commit
99d4e6d054
@@ -1432,20 +1432,17 @@ int IoctlHelperXe::xeVmBind(const VmBindParams &vmBindParams, bool isBind) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (!isBind) {
|
||||
constexpr auto oneSecTimeout = 1000000000ll;
|
||||
constexpr auto infiniteTimeout = -1;
|
||||
bool debuggingEnabled = drm.getRootDeviceEnvironment().executionEnvironment.isDebuggingEnabled();
|
||||
uint64_t timeout = debuggingEnabled ? infiniteTimeout : oneSecTimeout;
|
||||
if (debugManager.flags.VmBindWaitUserFenceTimeout.get() != -1) {
|
||||
timeout = debugManager.flags.VmBindWaitUserFenceTimeout.get();
|
||||
}
|
||||
ret = xeWaitUserFence(bind.exec_queue_id, DRM_XE_UFENCE_WAIT_OP_EQ,
|
||||
sync[0].addr,
|
||||
sync[0].timeline_value, timeout,
|
||||
false, NEO::InterruptId::notUsed, nullptr);
|
||||
constexpr auto oneSecTimeout = 1000000000ll;
|
||||
constexpr auto infiniteTimeout = -1;
|
||||
bool debuggingEnabled = drm.getRootDeviceEnvironment().executionEnvironment.isDebuggingEnabled();
|
||||
uint64_t timeout = debuggingEnabled ? infiniteTimeout : oneSecTimeout;
|
||||
if (debugManager.flags.VmBindWaitUserFenceTimeout.get() != -1) {
|
||||
timeout = debugManager.flags.VmBindWaitUserFenceTimeout.get();
|
||||
}
|
||||
return ret;
|
||||
return xeWaitUserFence(bind.exec_queue_id, DRM_XE_UFENCE_WAIT_OP_EQ,
|
||||
sync[0].addr,
|
||||
sync[0].timeline_value, timeout,
|
||||
false, NEO::InterruptId::notUsed, nullptr);
|
||||
}
|
||||
|
||||
std::string IoctlHelperXe::getDrmParamString(DrmParam drmParam) const {
|
||||
|
||||
@@ -414,9 +414,10 @@ TEST_F(IoctlHelperXeTest, givenDebuggingEnabledWhenCallingVmBindThenWaitUserFenc
|
||||
xeIoctlHelper->setVmBindUserFence(vmBindParams, vmBindExtUserFence);
|
||||
|
||||
EXPECT_EQ(0, xeIoctlHelper->vmBind(vmBindParams));
|
||||
EXPECT_EQ(0u, drm->waitUserFenceInputs.size());
|
||||
auto &waitUserFence = drm->waitUserFenceInputs[0];
|
||||
EXPECT_EQ(expectedTimeout, waitUserFence.timeout);
|
||||
drm->waitUserFenceInputs.clear();
|
||||
EXPECT_EQ(0, xeIoctlHelper->vmUnbind(vmBindParams));
|
||||
auto waitUserFence = drm->waitUserFenceInputs[0];
|
||||
waitUserFence = drm->waitUserFenceInputs[0];
|
||||
EXPECT_EQ(expectedTimeout, waitUserFence.timeout);
|
||||
}
|
||||
|
||||
@@ -1512,7 +1512,7 @@ TEST_F(IoctlHelperXeTest, givenDisabledFtrMultiTileArchWhenCreatingEngineInfoThe
|
||||
|
||||
using IoctlHelperXeFenceWaitTest = ::testing::Test;
|
||||
|
||||
TEST_F(IoctlHelperXeFenceWaitTest, whenCallingVmBindThenWaitUserFenceIsCalledOnlyDuringUnbind) {
|
||||
TEST_F(IoctlHelperXeFenceWaitTest, whenCallingVmBindThenWaitUserFenceIsCalled) {
|
||||
DebugManagerStateRestore restorer;
|
||||
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
|
||||
auto drm = DrmMockXe::create(*executionEnvironment->rootDeviceEnvironments[0]);
|
||||
@@ -1539,7 +1539,7 @@ TEST_F(IoctlHelperXeFenceWaitTest, whenCallingVmBindThenWaitUserFenceIsCalledOnl
|
||||
EXPECT_EQ(0, xeIoctlHelper->vmBind(vmBindParams));
|
||||
EXPECT_EQ(1u, drm->vmBindInputs.size());
|
||||
EXPECT_EQ(1u, drm->syncInputs.size());
|
||||
EXPECT_EQ(0u, drm->waitUserFenceInputs.size());
|
||||
EXPECT_EQ(1u, drm->waitUserFenceInputs.size());
|
||||
auto expectedMask = std::numeric_limits<uint64_t>::max();
|
||||
auto expectedTimeout = 1000000000ll;
|
||||
{
|
||||
@@ -1547,6 +1547,17 @@ TEST_F(IoctlHelperXeFenceWaitTest, whenCallingVmBindThenWaitUserFenceIsCalledOnl
|
||||
|
||||
EXPECT_EQ(fenceAddress, sync.addr);
|
||||
EXPECT_EQ(fenceValue, sync.timeline_value);
|
||||
|
||||
auto &waitUserFence = drm->waitUserFenceInputs[0];
|
||||
|
||||
EXPECT_EQ(fenceAddress, waitUserFence.addr);
|
||||
EXPECT_EQ(static_cast<uint16_t>(DRM_XE_UFENCE_WAIT_OP_EQ), waitUserFence.op);
|
||||
EXPECT_EQ(0u, waitUserFence.flags);
|
||||
EXPECT_EQ(fenceValue, waitUserFence.value);
|
||||
EXPECT_EQ(expectedMask, waitUserFence.mask);
|
||||
EXPECT_EQ(expectedTimeout, waitUserFence.timeout);
|
||||
EXPECT_EQ(0u, waitUserFence.exec_queue_id);
|
||||
|
||||
EXPECT_EQ(expectedFlags, drm->vmBindInputs[0].bind.flags);
|
||||
}
|
||||
drm->vmBindInputs.clear();
|
||||
@@ -1576,7 +1587,7 @@ TEST_F(IoctlHelperXeFenceWaitTest, whenCallingVmBindThenWaitUserFenceIsCalledOnl
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(IoctlHelperXeTest, givenVmBindWaitUserFenceTimeoutWhenCallingVmUnBindThenWaitUserFenceIsCalledWithSpecificTimeout) {
|
||||
TEST_F(IoctlHelperXeTest, givenVmBindWaitUserFenceTimeoutWhenCallingVmBindThenWaitUserFenceIsCalledWithSpecificTimeout) {
|
||||
DebugManagerStateRestore restorer;
|
||||
debugManager.flags.VmBindWaitUserFenceTimeout.set(5000000000ll);
|
||||
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
|
||||
@@ -1602,7 +1613,7 @@ TEST_F(IoctlHelperXeTest, givenVmBindWaitUserFenceTimeoutWhenCallingVmUnBindThen
|
||||
EXPECT_EQ(0u, vmBindParams.flags);
|
||||
vmBindParams.flags = 0x12345; // set non-zero to check if flags are passed
|
||||
auto expectedFlags = vmBindParams.flags;
|
||||
EXPECT_EQ(0, xeIoctlHelper->vmUnbind(vmBindParams));
|
||||
EXPECT_EQ(0, xeIoctlHelper->vmBind(vmBindParams));
|
||||
EXPECT_EQ(1u, drm->vmBindInputs.size());
|
||||
EXPECT_EQ(1u, drm->syncInputs.size());
|
||||
EXPECT_EQ(1u, drm->waitUserFenceInputs.size());
|
||||
@@ -1678,6 +1689,7 @@ TEST_F(IoctlHelperXeTest, whenUserFenceFailsThenErrorIsPropagated) {
|
||||
int errorValue = -1;
|
||||
drm->waitUserFenceReturn = errorValue;
|
||||
|
||||
EXPECT_EQ(errorValue, xeIoctlHelper->vmBind(vmBindParams));
|
||||
EXPECT_EQ(errorValue, xeIoctlHelper->vmUnbind(vmBindParams));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user