From 5e8fb19e5dcb44eef25055e2faaf47860bece9be Mon Sep 17 00:00:00 2001 From: "Venevtsev, Igor" Date: Fri, 25 Jan 2019 10:20:32 +0100 Subject: [PATCH] Remove OCL Events concept from EnqueueOperation and dispatchWalker Change-Id: Iec55b0be673a2a40b9621212add224a33d4abc5d --- runtime/command_queue/enqueue_common.h | 23 +++-- runtime/command_queue/gpgpu_walker.h | 6 +- runtime/command_queue/gpgpu_walker.inl | 10 +-- runtime/command_queue/hardware_interface.h | 3 +- runtime/command_queue/hardware_interface.inl | 14 +-- .../command_stream_receiver_hw.h | 1 + .../command_queue/dispatch_walker_tests.cpp | 74 ++++++---------- .../get_size_required_buffer_tests.cpp | 14 +-- .../parent_kernel_dispatch_tests.cpp | 26 ++---- .../submit_blocked_parent_kernel_tests.cpp | 3 +- unit_tests/helpers/timestamp_packet_tests.cpp | 87 ++++++++++--------- unit_tests/profiling/profiling_tests.cpp | 4 +- 12 files changed, 113 insertions(+), 152 deletions(-) diff --git a/runtime/command_queue/enqueue_common.h b/runtime/command_queue/enqueue_common.h index 890fe66214..68edc47009 100644 --- a/runtime/command_queue/enqueue_common.h +++ b/runtime/command_queue/enqueue_common.h @@ -182,9 +182,6 @@ void CommandQueueHw::enqueueHandler(Surface **surfacesForResidency, auto taskLevel = 0u; obtainTaskLevelAndBlockedStatus(taskLevel, numEventsInWaitList, eventWaitList, blockQueue, commandType); - auto &commandStream = getCommandStream(*this, numEventsInWaitList, profilingRequired, perfCountersRequired, multiDispatchInfo); - auto commandStreamStart = commandStream.getUsed(); - DBG_LOG(EventsDebugEnable, "blockQueue", blockQueue, "virtualEvent", virtualEvent, "taskLevel", taskLevel); if (parentKernel && !blockQueue) { @@ -204,6 +201,19 @@ void CommandQueueHw::enqueueHandler(Surface **surfacesForResidency, TimestampPacketContainer previousTimestampPacketNodes; EventsRequest eventsRequest(numEventsInWaitList, eventWaitList, event); + CsrDependencies csrDeps; + + if (getCommandStreamReceiver().peekTimestampPacketWriteEnabled()) { + csrDeps.fillFromEventsRequestAndMakeResident(eventsRequest, getCommandStreamReceiver(), CsrDependencies::DependenciesType::OnCsr); + + if (!multiDispatchInfo.empty()) { + obtainNewTimestampPacketNodes(multiDispatchInfo.size(), previousTimestampPacketNodes); + csrDeps.push_back(&previousTimestampPacketNodes); + } + } + + auto &commandStream = getCommandStream(*this, csrDeps, profilingRequired, perfCountersRequired, multiDispatchInfo); + auto commandStreamStart = commandStream.getUsed(); if (multiDispatchInfo.empty() == false) { HwPerfCounter *hwPerfCounter = nullptr; @@ -220,10 +230,6 @@ void CommandQueueHw::enqueueHandler(Surface **surfacesForResidency, } } - if (getCommandStreamReceiver().peekTimestampPacketWriteEnabled()) { - obtainNewTimestampPacketNodes(multiDispatchInfo.size(), previousTimestampPacketNodes); - } - if (eventBuilder.getEvent()) { if (getCommandStreamReceiver().peekTimestampPacketWriteEnabled()) { eventBuilder.getEvent()->addTimestampPacketNodes(*timestampPacketContainer); @@ -253,8 +259,7 @@ void CommandQueueHw::enqueueHandler(Surface **surfacesForResidency, HardwareInterface::dispatchWalker( *this, multiDispatchInfo, - numEventsInWaitList, - eventWaitList, + csrDeps, &blockedCommandsData, hwTimeStamps, hwPerfCounter, diff --git a/runtime/command_queue/gpgpu_walker.h b/runtime/command_queue/gpgpu_walker.h index fe91de2571..2eb3912895 100644 --- a/runtime/command_queue/gpgpu_walker.h +++ b/runtime/command_queue/gpgpu_walker.h @@ -208,7 +208,7 @@ class GpgpuWalkerHelper { template struct EnqueueOperation { using PIPE_CONTROL = typename GfxFamily::PIPE_CONTROL; - static size_t getTotalSizeRequiredCS(uint32_t eventType, cl_uint numEventsInWaitList, bool reserveProfilingCmdsSpace, bool reservePerfCounters, CommandQueue &commandQueue, const MultiDispatchInfo &multiDispatchInfo); + static size_t getTotalSizeRequiredCS(uint32_t eventType, const CsrDependencies &csrDeps, bool reserveProfilingCmdsSpace, bool reservePerfCounters, CommandQueue &commandQueue, const MultiDispatchInfo &multiDispatchInfo); static size_t getSizeRequiredCS(uint32_t cmdType, bool reserveProfilingCmdsSpace, bool reservePerfCounters, CommandQueue &commandQueue, const Kernel *pKernel); static size_t getSizeRequiredForTimestampPacketWrite(); @@ -224,8 +224,8 @@ LinearStream &getCommandStream(CommandQueue &commandQueue, bool reserveProfiling } template -LinearStream &getCommandStream(CommandQueue &commandQueue, cl_uint numEventsInWaitList, bool reserveProfilingCmdsSpace, bool reservePerfCounterCmdsSpace, const MultiDispatchInfo &multiDispatchInfo) { - size_t expectedSizeCS = EnqueueOperation::getTotalSizeRequiredCS(eventType, numEventsInWaitList, reserveProfilingCmdsSpace, reservePerfCounterCmdsSpace, commandQueue, multiDispatchInfo); +LinearStream &getCommandStream(CommandQueue &commandQueue, const CsrDependencies &csrDeps, bool reserveProfilingCmdsSpace, bool reservePerfCounterCmdsSpace, const MultiDispatchInfo &multiDispatchInfo) { + size_t expectedSizeCS = EnqueueOperation::getTotalSizeRequiredCS(eventType, csrDeps, reserveProfilingCmdsSpace, reservePerfCounterCmdsSpace, commandQueue, multiDispatchInfo); return commandQueue.getCS(expectedSizeCS); } diff --git a/runtime/command_queue/gpgpu_walker.inl b/runtime/command_queue/gpgpu_walker.inl index d446dd462b..a7cf386711 100644 --- a/runtime/command_queue/gpgpu_walker.inl +++ b/runtime/command_queue/gpgpu_walker.inl @@ -378,7 +378,7 @@ void GpgpuWalkerHelper::adjustMiStoreRegMemMode(MI_STORE_REG_MEM -size_t EnqueueOperation::getTotalSizeRequiredCS(uint32_t eventType, cl_uint numEventsInWaitList, bool reserveProfilingCmdsSpace, bool reservePerfCounters, CommandQueue &commandQueue, const MultiDispatchInfo &multiDispatchInfo) { +size_t EnqueueOperation::getTotalSizeRequiredCS(uint32_t eventType, const CsrDependencies &csrDeps, bool reserveProfilingCmdsSpace, bool reservePerfCounters, CommandQueue &commandQueue, const MultiDispatchInfo &multiDispatchInfo) { size_t expectedSizeCS = 0; Kernel *parentKernel = multiDispatchInfo.peekParentKernel(); if (multiDispatchInfo.peekMainKernel() && multiDispatchInfo.peekMainKernel()->isAuxTranslationRequired()) { @@ -395,14 +395,8 @@ size_t EnqueueOperation::getTotalSizeRequiredCS(uint32_t eventType, c expectedSizeCS += EnqueueOperation::getSizeRequiredCS(eventType, reserveProfilingCmdsSpace, reservePerfCounters, commandQueue, &scheduler); } if (commandQueue.getCommandStreamReceiver().peekTimestampPacketWriteEnabled()) { - auto semaphoreSize = sizeof(typename GfxFamily::MI_SEMAPHORE_WAIT); - auto atomicSize = sizeof(typename GfxFamily::MI_ATOMIC); - expectedSizeCS += EnqueueOperation::getSizeRequiredForTimestampPacketWrite(); - expectedSizeCS += numEventsInWaitList * (semaphoreSize + atomicSize); - if (!commandQueue.isOOQEnabled()) { - expectedSizeCS += semaphoreSize + atomicSize; - } + expectedSizeCS += TimestampPacketHelper::getRequiredCmdStreamSize(csrDeps); } return expectedSizeCS; } diff --git a/runtime/command_queue/hardware_interface.h b/runtime/command_queue/hardware_interface.h index 7110baa06a..fa1cf46432 100644 --- a/runtime/command_queue/hardware_interface.h +++ b/runtime/command_queue/hardware_interface.h @@ -37,8 +37,7 @@ class HardwareInterface { static void dispatchWalker( CommandQueue &commandQueue, const MultiDispatchInfo &multiDispatchInfo, - cl_uint numEventsInWaitList, - const cl_event *eventWaitList, + const CsrDependencies &csrDependencies, KernelOperation **blockedCommandsData, TagNode *hwTimeStamps, HwPerfCounter *hwPerfCounter, diff --git a/runtime/command_queue/hardware_interface.inl b/runtime/command_queue/hardware_interface.inl index 3f73331497..2281250c70 100644 --- a/runtime/command_queue/hardware_interface.inl +++ b/runtime/command_queue/hardware_interface.inl @@ -24,8 +24,7 @@ template void HardwareInterface::dispatchWalker( CommandQueue &commandQueue, const MultiDispatchInfo &multiDispatchInfo, - cl_uint numEventsInWaitList, - const cl_event *eventWaitList, + const CsrDependencies &csrDependencies, KernelOperation **blockedCommandsData, TagNode *hwTimeStamps, HwPerfCounter *hwPerfCounter, @@ -90,16 +89,7 @@ void HardwareInterface::dispatchWalker( ssh = &getIndirectHeap(commandQueue, multiDispatchInfo); } - if (commandQueue.getCommandStreamReceiver().peekTimestampPacketWriteEnabled()) { - CsrDependencies csrDeps; - csrDeps.fillFromEventsRequestAndMakeResident(EventsRequest(numEventsInWaitList, eventWaitList, nullptr), - commandQueue.getCommandStreamReceiver(), CsrDependencies::DependenciesType::OnCsr); - if (previousTimestampPacketNodes) { - csrDeps.push_back(previousTimestampPacketNodes); - } - - TimestampPacketHelper::programCsrDependencies(*commandStream, csrDeps); - } + TimestampPacketHelper::programCsrDependencies(*commandStream, csrDependencies); dsh->align(KernelCommandsHelper::alignInterfaceDescriptorData); diff --git a/runtime/command_stream/command_stream_receiver_hw.h b/runtime/command_stream/command_stream_receiver_hw.h index ca275ea1cc..25731d669a 100644 --- a/runtime/command_stream/command_stream_receiver_hw.h +++ b/runtime/command_stream/command_stream_receiver_hw.h @@ -7,6 +7,7 @@ #pragma once #include "runtime/command_stream/command_stream_receiver.h" +#include "runtime/helpers/csr_deps.h" #include "runtime/helpers/hw_info.h" #include "runtime/helpers/dirty_state_helpers.h" #include "runtime/gen_common/hw_cmds.h" diff --git a/unit_tests/command_queue/dispatch_walker_tests.cpp b/unit_tests/command_queue/dispatch_walker_tests.cpp index 16b6f261fa..38d7949f99 100644 --- a/unit_tests/command_queue/dispatch_walker_tests.cpp +++ b/unit_tests/command_queue/dispatch_walker_tests.cpp @@ -133,8 +133,7 @@ HWTEST_F(DispatchWalkerTest, shouldntChangeCommandStreamMemory) { HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, - 0, - nullptr, + CsrDependencies(), nullptr, nullptr, nullptr, @@ -182,8 +181,7 @@ HWTEST_F(DispatchWalkerTest, noLocalIdsShouldntCrash) { HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, - 0, - nullptr, + CsrDependencies(), nullptr, nullptr, nullptr, @@ -213,8 +211,7 @@ HWTEST_F(DispatchWalkerTest, dataParameterWorkDimensionswithDefaultLwsAlgorithm) HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, - 0, - nullptr, + CsrDependencies(), nullptr, nullptr, nullptr, @@ -245,8 +242,7 @@ HWTEST_F(DispatchWalkerTest, dataParameterWorkDimensionswithSquaredLwsAlgorithm) HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, - 0, - nullptr, + CsrDependencies(), nullptr, nullptr, nullptr, @@ -275,8 +271,7 @@ HWTEST_F(DispatchWalkerTest, dataParameterWorkDimensionswithNDLwsAlgorithm) { HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, - 0, - nullptr, + CsrDependencies(), nullptr, nullptr, nullptr, @@ -306,8 +301,7 @@ HWTEST_F(DispatchWalkerTest, dataParameterWorkDimensionswithOldLwsAlgorithm) { HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, - 0, - nullptr, + CsrDependencies(), nullptr, nullptr, nullptr, @@ -337,8 +331,7 @@ HWTEST_F(DispatchWalkerTest, dataParameterNumWorkGroups) { HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, - 0, - nullptr, + CsrDependencies(), nullptr, nullptr, nullptr, @@ -370,8 +363,7 @@ HWTEST_F(DispatchWalkerTest, dataParameterNoLocalWorkSizeWithOutComputeND) { HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, - 0, - nullptr, + CsrDependencies(), nullptr, nullptr, nullptr, @@ -402,8 +394,7 @@ HWTEST_F(DispatchWalkerTest, dataParameterNoLocalWorkSizeWithComputeND) { HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, - 0, - nullptr, + CsrDependencies(), nullptr, nullptr, nullptr, @@ -435,8 +426,7 @@ HWTEST_F(DispatchWalkerTest, dataParameterNoLocalWorkSizeWithComputeSquared) { HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, - 0, - nullptr, + CsrDependencies(), nullptr, nullptr, nullptr, @@ -468,8 +458,7 @@ HWTEST_F(DispatchWalkerTest, dataParameterNoLocalWorkSizeWithOutComputeSquaredAn HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, - 0, - nullptr, + CsrDependencies(), nullptr, nullptr, nullptr, @@ -499,8 +488,7 @@ HWTEST_F(DispatchWalkerTest, dataParameterLocalWorkSize) { HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, - 0, - nullptr, + CsrDependencies(), nullptr, nullptr, nullptr, @@ -533,8 +521,7 @@ HWTEST_F(DispatchWalkerTest, dataParameterLocalWorkSizes) { HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, - 0, - nullptr, + CsrDependencies(), nullptr, nullptr, nullptr, @@ -571,8 +558,7 @@ HWTEST_F(DispatchWalkerTest, dataParameterLocalWorkSizeForSplitKernel) { HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, - 0, - nullptr, + CsrDependencies(), nullptr, nullptr, nullptr, @@ -623,8 +609,7 @@ HWTEST_F(DispatchWalkerTest, dataParameterLocalWorkSizesForSplitWalker) { HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, - 0, - nullptr, + CsrDependencies(), nullptr, nullptr, nullptr, @@ -679,8 +664,7 @@ HWTEST_F(DispatchWalkerTest, dispatchWalkerDoesntConsumeCommandStreamWhenQueueIs HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, - 0, - nullptr, + CsrDependencies(), &blockedCommandsData, nullptr, nullptr, @@ -720,8 +704,7 @@ HWTEST_F(DispatchWalkerTest, dispatchWalkerShouldGetRequiredHeapSizesFromKernelW HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, - 0, - nullptr, + CsrDependencies(), &blockedCommandsData, nullptr, nullptr, @@ -759,8 +742,7 @@ HWTEST_F(DispatchWalkerTest, dispatchWalkerShouldGetRequiredHeapSizesFromMdiWhen HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, - 0, - nullptr, + CsrDependencies(), &blockedCommandsData, nullptr, nullptr, @@ -793,8 +775,7 @@ HWTEST_F(DispatchWalkerTest, dispatchWalkerWithMultipleDispatchInfo) { HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, - 0, - nullptr, + CsrDependencies(), nullptr, nullptr, nullptr, @@ -836,8 +817,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, DispatchWalkerTest, dispatchWalkerWithMultipleDispat HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, - 0, - nullptr, + CsrDependencies(), nullptr, nullptr, nullptr, @@ -922,8 +902,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, DispatchWalkerTest, dispatchWalkerWithMultipleDispat HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, - 0, - nullptr, + CsrDependencies(), nullptr, nullptr, nullptr, @@ -969,8 +948,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, DispatchWalkerTest, dispatchWalkerWithMultipleDispat HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, - 0, - nullptr, + CsrDependencies(), nullptr, nullptr, nullptr, @@ -1021,8 +999,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, DispatchWalkerTest, dispatchWalkerWithMultipleDispat HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, - 0, - nullptr, + CsrDependencies(), nullptr, nullptr, nullptr, @@ -1071,7 +1048,7 @@ HWTEST_F(DispatchWalkerTest, givenMultiDispatchWhenWhitelistedRegisterForCoheren DispatchInfo di2(&kernel, 1, Vec3(1, 1, 1), Vec3(1, 1, 1), Vec3(0, 0, 0)); MockMultiDispatchInfo multiDispatchInfo(std::vector({&di1, &di2})); - HardwareInterface::dispatchWalker(*pCmdQ, multiDispatchInfo, 0, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, pDevice->getPreemptionMode(), false); + HardwareInterface::dispatchWalker(*pCmdQ, multiDispatchInfo, CsrDependencies(), nullptr, nullptr, nullptr, nullptr, nullptr, pDevice->getPreemptionMode(), false); hwParser.parseCommands(cmdStream, 0); @@ -1127,8 +1104,7 @@ HWTEST_F(DispatchWalkerTest, givenKernelWhenAuxTranslationRequiredThenPipeContro HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, - 0, - nullptr, + CsrDependencies(), nullptr, nullptr, nullptr, diff --git a/unit_tests/command_queue/get_size_required_buffer_tests.cpp b/unit_tests/command_queue/get_size_required_buffer_tests.cpp index b78f5d2e37..0624ae65a1 100644 --- a/unit_tests/command_queue/get_size_required_buffer_tests.cpp +++ b/unit_tests/command_queue/get_size_required_buffer_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2018 Intel Corporation + * Copyright (C) 2017-2019 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -96,7 +96,7 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueFillBuffer) { auto usedAfterIOH = ioh.getUsed(); auto usedAfterSSH = ssh.getUsed(); - auto expectedSizeCS = EnqueueOperation::getTotalSizeRequiredCS(CL_COMMAND_FILL_BUFFER, 0, false, false, *pCmdQ, multiDispatchInfo); + auto expectedSizeCS = EnqueueOperation::getTotalSizeRequiredCS(CL_COMMAND_FILL_BUFFER, CsrDependencies(), false, false, *pCmdQ, multiDispatchInfo); auto expectedSizeDSH = KernelCommandsHelper::getTotalSizeRequiredDSH(multiDispatchInfo); auto expectedSizeIOH = KernelCommandsHelper::getTotalSizeRequiredIOH(multiDispatchInfo); auto expectedSizeSSH = KernelCommandsHelper::getTotalSizeRequiredSSH(multiDispatchInfo); @@ -147,7 +147,7 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueCopyBuffer) { auto usedAfterIOH = ioh.getUsed(); auto usedAfterSSH = ssh.getUsed(); - auto expectedSizeCS = EnqueueOperation::getTotalSizeRequiredCS(CL_COMMAND_COPY_BUFFER, 0, false, false, *pCmdQ, multiDispatchInfo); + auto expectedSizeCS = EnqueueOperation::getTotalSizeRequiredCS(CL_COMMAND_COPY_BUFFER, CsrDependencies(), false, false, *pCmdQ, multiDispatchInfo); auto expectedSizeDSH = KernelCommandsHelper::getTotalSizeRequiredDSH(multiDispatchInfo); auto expectedSizeIOH = KernelCommandsHelper::getTotalSizeRequiredIOH(multiDispatchInfo); auto expectedSizeSSH = KernelCommandsHelper::getTotalSizeRequiredSSH(multiDispatchInfo); @@ -199,7 +199,7 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueReadBufferNonBlocking) { auto usedAfterIOH = ioh.getUsed(); auto usedAfterSSH = ssh.getUsed(); - auto expectedSizeCS = EnqueueOperation::getTotalSizeRequiredCS(CL_COMMAND_READ_BUFFER, 0, false, false, *pCmdQ, multiDispatchInfo); + auto expectedSizeCS = EnqueueOperation::getTotalSizeRequiredCS(CL_COMMAND_READ_BUFFER, CsrDependencies(), false, false, *pCmdQ, multiDispatchInfo); auto expectedSizeDSH = KernelCommandsHelper::getTotalSizeRequiredDSH(multiDispatchInfo); auto expectedSizeIOH = KernelCommandsHelper::getTotalSizeRequiredIOH(multiDispatchInfo); auto expectedSizeSSH = KernelCommandsHelper::getTotalSizeRequiredSSH(multiDispatchInfo); @@ -252,7 +252,7 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueReadBufferBlocking) { auto usedAfterIOH = ioh.getUsed(); auto usedAfterSSH = ssh.getUsed(); - auto expectedSizeCS = EnqueueOperation::getTotalSizeRequiredCS(CL_COMMAND_READ_BUFFER, 0, false, false, *pCmdQ, multiDispatchInfo); + auto expectedSizeCS = EnqueueOperation::getTotalSizeRequiredCS(CL_COMMAND_READ_BUFFER, CsrDependencies(), false, false, *pCmdQ, multiDispatchInfo); auto expectedSizeDSH = KernelCommandsHelper::getTotalSizeRequiredDSH(multiDispatchInfo); auto expectedSizeIOH = KernelCommandsHelper::getTotalSizeRequiredIOH(multiDispatchInfo); auto expectedSizeSSH = KernelCommandsHelper::getTotalSizeRequiredSSH(multiDispatchInfo); @@ -305,7 +305,7 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueWriteBufferNonBlocking) { auto usedAfterIOH = ioh.getUsed(); auto usedAfterSSH = ssh.getUsed(); - auto expectedSizeCS = EnqueueOperation::getTotalSizeRequiredCS(CL_COMMAND_WRITE_BUFFER, 0, false, false, *pCmdQ, multiDispatchInfo); + auto expectedSizeCS = EnqueueOperation::getTotalSizeRequiredCS(CL_COMMAND_WRITE_BUFFER, CsrDependencies(), false, false, *pCmdQ, multiDispatchInfo); auto expectedSizeDSH = KernelCommandsHelper::getTotalSizeRequiredDSH(multiDispatchInfo); auto expectedSizeIOH = KernelCommandsHelper::getTotalSizeRequiredIOH(multiDispatchInfo); auto expectedSizeSSH = KernelCommandsHelper::getTotalSizeRequiredSSH(multiDispatchInfo); @@ -355,7 +355,7 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueWriteBufferBlocking) { auto usedAfterIOH = ioh.getUsed(); auto usedAfterSSH = ssh.getUsed(); - auto expectedSizeCS = EnqueueOperation::getTotalSizeRequiredCS(CL_COMMAND_WRITE_BUFFER, 0, false, false, *pCmdQ, multiDispatchInfo); + auto expectedSizeCS = EnqueueOperation::getTotalSizeRequiredCS(CL_COMMAND_WRITE_BUFFER, CsrDependencies(), false, false, *pCmdQ, multiDispatchInfo); auto expectedSizeDSH = KernelCommandsHelper::getTotalSizeRequiredDSH(multiDispatchInfo); auto expectedSizeIOH = KernelCommandsHelper::getTotalSizeRequiredIOH(multiDispatchInfo); auto expectedSizeSSH = KernelCommandsHelper::getTotalSizeRequiredSSH(multiDispatchInfo); diff --git a/unit_tests/execution_model/parent_kernel_dispatch_tests.cpp b/unit_tests/execution_model/parent_kernel_dispatch_tests.cpp index 438c82d4aa..73b7253aca 100644 --- a/unit_tests/execution_model/parent_kernel_dispatch_tests.cpp +++ b/unit_tests/execution_model/parent_kernel_dispatch_tests.cpp @@ -46,8 +46,7 @@ HWTEST_P(ParentKernelDispatchTest, givenParentKernelWhenQueueIsNotBlockedThenDev HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, - 0, - nullptr, + CsrDependencies(), &blockedCommandsData, nullptr, nullptr, @@ -103,8 +102,7 @@ HWTEST_P(ParentKernelDispatchTest, givenParentKernelWhenQueueIsNotBlockedThenDef HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, - 0, - nullptr, + CsrDependencies(), &blockedCommandsData, nullptr, nullptr, @@ -130,8 +128,7 @@ HWTEST_P(ParentKernelDispatchTest, givenParentKernelWhenQueueIsNotBlockedThenSSH HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, - 0, - nullptr, + CsrDependencies(), &blockedCommandsData, nullptr, nullptr, @@ -167,8 +164,7 @@ HWTEST_P(ParentKernelDispatchTest, givenParentKernelWhenQueueIsBlockedThenSSHSiz HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, - 0, - nullptr, + CsrDependencies(), &blockedCommandsData, nullptr, nullptr, @@ -234,7 +230,7 @@ HWTEST_F(ParentKernelCommandStreamFixture, GivenDispatchInfoWithParentKernelWhen size_t totalKernelSize = alignUp(numOfKernels * size, MemoryConstants::pageSize); - LinearStream &commandStream = getCommandStream(*pCmdQ, 0, false, false, multiDispatchInfo); + LinearStream &commandStream = getCommandStream(*pCmdQ, CsrDependencies(), false, false, multiDispatchInfo); EXPECT_LT(totalKernelSize, commandStream.getMaxAvailableSpace()); @@ -269,8 +265,7 @@ HWTEST_F(MockParentKernelDispatch, GivenBlockedQueueWhenParentKernelIsDispatched HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, - 0, - nullptr, + CsrDependencies(), &blockedCommandsData, nullptr, nullptr, @@ -304,8 +299,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, MockParentKernelDispatch, GivenParentKernelWhenDispa HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, - 0, - nullptr, + CsrDependencies(), &blockedCommandsData, nullptr, nullptr, @@ -363,8 +357,7 @@ HWTEST_F(MockParentKernelDispatch, GivenUsedSSHHeapWhenParentKernelIsDispatchedT HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, - 0, - nullptr, + CsrDependencies(), &blockedCommandsData, nullptr, nullptr, @@ -400,8 +393,7 @@ HWTEST_F(MockParentKernelDispatch, GivenNotUsedSSHHeapWhenParentKernelIsDispatch HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, - 0, - nullptr, + CsrDependencies(), &blockedCommandsData, nullptr, nullptr, diff --git a/unit_tests/execution_model/submit_blocked_parent_kernel_tests.cpp b/unit_tests/execution_model/submit_blocked_parent_kernel_tests.cpp index 51635f7dd5..5a49c41de8 100644 --- a/unit_tests/execution_model/submit_blocked_parent_kernel_tests.cpp +++ b/unit_tests/execution_model/submit_blocked_parent_kernel_tests.cpp @@ -423,8 +423,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelCommandQueueFixture, givenBlockedCommand HardwareInterface::dispatchWalker( *pCmdQ, multiDispatchInfo, - 0, - nullptr, + CsrDependencies(), &blockedCommandsData, nullptr, nullptr, diff --git a/unit_tests/helpers/timestamp_packet_tests.cpp b/unit_tests/helpers/timestamp_packet_tests.cpp index 7aa81b1e42..2c87bf839f 100644 --- a/unit_tests/helpers/timestamp_packet_tests.cpp +++ b/unit_tests/helpers/timestamp_packet_tests.cpp @@ -260,16 +260,14 @@ HWCMDTEST_F(IGFX_GEN8_CORE, TimestampPacketTests, givenTimestampPacketWriteEnabl MockMultiDispatchInfo multiDispatchInfo(std::vector({kernel->mockKernel, kernel2.mockKernel})); device->getUltCommandStreamReceiver().timestampPacketWriteEnabled = false; - getCommandStream(*mockCmdQ, 0, false, false, multiDispatchInfo); + getCommandStream(*mockCmdQ, CsrDependencies(), false, false, multiDispatchInfo); auto sizeWithDisabled = mockCmdQ->requestedCmdStreamSize; device->getUltCommandStreamReceiver().timestampPacketWriteEnabled = true; - getCommandStream(*mockCmdQ, 0, false, false, multiDispatchInfo); + getCommandStream(*mockCmdQ, CsrDependencies(), false, false, multiDispatchInfo); auto sizeWithEnabled = mockCmdQ->requestedCmdStreamSize; - auto extendedSize = sizeWithDisabled + sizeof(typename FamilyType::PIPE_CONTROL) + - sizeof(typename FamilyType::MI_SEMAPHORE_WAIT) + sizeof(typename FamilyType::MI_ATOMIC); - + auto extendedSize = sizeWithDisabled + sizeof(typename FamilyType::PIPE_CONTROL); EXPECT_EQ(sizeWithEnabled, extendedSize); } @@ -278,16 +276,16 @@ HWTEST_F(TimestampPacketTests, givenTimestampPacketWriteEnabledAndOoqWhenEstimat mockCmdQ->setOoqEnabled(); device->getUltCommandStreamReceiver().timestampPacketWriteEnabled = false; - getCommandStream(*mockCmdQ, 0, false, false, multiDispatchInfo); + getCommandStream(*mockCmdQ, CsrDependencies(), false, false, multiDispatchInfo); auto sizeWithDisabled = mockCmdQ->requestedCmdStreamSize; device->getUltCommandStreamReceiver().timestampPacketWriteEnabled = true; MockTimestampPacketContainer timestamp1(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 1); - MockTimestampPacketContainer timestamp2(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 1); - MockTimestampPacketContainer timestamp3(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 1); - MockTimestampPacketContainer timestamp4(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 1); - MockTimestampPacketContainer timestamp5(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 1); + MockTimestampPacketContainer timestamp2(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 2); + MockTimestampPacketContainer timestamp3(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 3); + MockTimestampPacketContainer timestamp4(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 4); + MockTimestampPacketContainer timestamp5(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 5); Event event1(mockCmdQ, 0, 0, 0); event1.addTimestampPacketNodes(timestamp1); @@ -307,11 +305,11 @@ HWTEST_F(TimestampPacketTests, givenTimestampPacketWriteEnabledAndOoqWhenEstimat CsrDependencies csrDeps; csrDeps.fillFromEventsRequestAndMakeResident(eventsRequest, device->getCommandStreamReceiver(), CsrDependencies::DependenciesType::OnCsr); - getCommandStream(*mockCmdQ, numEventsOnWaitlist, false, false, multiDispatchInfo); + getCommandStream(*mockCmdQ, csrDeps, false, false, multiDispatchInfo); auto sizeWithEnabled = mockCmdQ->requestedCmdStreamSize; size_t extendedSize = sizeWithDisabled + EnqueueOperation::getSizeRequiredForTimestampPacketWrite() + - (numEventsOnWaitlist * (sizeof(typename FamilyType::MI_SEMAPHORE_WAIT) + sizeof(typename FamilyType::MI_ATOMIC))); + ((1 + 2 + 3 + 4 + 5) * (sizeof(typename FamilyType::MI_SEMAPHORE_WAIT) + sizeof(typename FamilyType::MI_ATOMIC))); EXPECT_EQ(sizeWithEnabled, extendedSize); } @@ -321,16 +319,16 @@ HWTEST_F(TimestampPacketTests, givenTimestampPacketWriteEnabledWhenEstimatingStr MockMultiDispatchInfo multiDispatchInfo(std::vector({kernel->mockKernel, kernel2.mockKernel})); device->getUltCommandStreamReceiver().timestampPacketWriteEnabled = false; - getCommandStream(*mockCmdQ, 0, false, false, multiDispatchInfo); + getCommandStream(*mockCmdQ, CsrDependencies(), false, false, multiDispatchInfo); auto sizeWithDisabled = mockCmdQ->requestedCmdStreamSize; device->getUltCommandStreamReceiver().timestampPacketWriteEnabled = true; MockTimestampPacketContainer timestamp1(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 1); - MockTimestampPacketContainer timestamp2(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 1); - MockTimestampPacketContainer timestamp3(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 1); - MockTimestampPacketContainer timestamp4(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 1); - MockTimestampPacketContainer timestamp5(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 1); + MockTimestampPacketContainer timestamp2(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 2); + MockTimestampPacketContainer timestamp3(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 3); + MockTimestampPacketContainer timestamp4(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 4); + MockTimestampPacketContainer timestamp5(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 5); Event event1(mockCmdQ, 0, 0, 0); event1.addTimestampPacketNodes(timestamp1); @@ -350,11 +348,11 @@ HWTEST_F(TimestampPacketTests, givenTimestampPacketWriteEnabledWhenEstimatingStr CsrDependencies csrDeps; csrDeps.fillFromEventsRequestAndMakeResident(eventsRequest, device->getCommandStreamReceiver(), CsrDependencies::DependenciesType::OnCsr); - getCommandStream(*mockCmdQ, numEventsOnWaitlist, false, false, multiDispatchInfo); + getCommandStream(*mockCmdQ, csrDeps, false, false, multiDispatchInfo); auto sizeWithEnabled = mockCmdQ->requestedCmdStreamSize; size_t extendedSize = sizeWithDisabled + EnqueueOperation::getSizeRequiredForTimestampPacketWrite() + - ((numEventsOnWaitlist + 1) * (sizeof(typename FamilyType::MI_SEMAPHORE_WAIT) + sizeof(typename FamilyType::MI_ATOMIC))); + ((1 + 2 + 3 + 4 + 5) * (sizeof(typename FamilyType::MI_SEMAPHORE_WAIT) + sizeof(typename FamilyType::MI_ATOMIC))); EXPECT_EQ(sizeWithEnabled, extendedSize); } @@ -379,10 +377,10 @@ HWTEST_F(TimestampPacketTests, givenEventsRequestWithEventsWithoutTimestampsWhen device->getUltCommandStreamReceiver().timestampPacketWriteEnabled = true; MockTimestampPacketContainer timestamp1(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 1); - MockTimestampPacketContainer timestamp2(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 1); - MockTimestampPacketContainer timestamp3(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 1); - MockTimestampPacketContainer timestamp4(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 1); - MockTimestampPacketContainer timestamp5(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 1); + MockTimestampPacketContainer timestamp2(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 2); + MockTimestampPacketContainer timestamp3(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 3); + MockTimestampPacketContainer timestamp4(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 4); + MockTimestampPacketContainer timestamp5(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 5); Event event1(mockCmdQ, 0, 0, 0); event1.addTimestampPacketNodes(timestamp1); @@ -405,6 +403,9 @@ HWTEST_F(TimestampPacketTests, givenEventsRequestWithEventsWithoutTimestampsWhen csrDepsSize3.fillFromEventsRequestAndMakeResident(eventsRequest2, device->getCommandStreamReceiver(), CsrDependencies::DependenciesType::OnCsr); EXPECT_EQ(3u, csrDepsSize3.size()); + + size_t expectedSize = (1 + 3 + 5) * (sizeof(typename FamilyType::MI_SEMAPHORE_WAIT) + sizeof(typename FamilyType::MI_ATOMIC)); + EXPECT_EQ(expectedSize, TimestampPacketHelper::getRequiredCmdStreamSize(csrDepsSize3)); } HWCMDTEST_F(IGFX_GEN8_CORE, TimestampPacketTests, givenTimestampPacketWhenDispatchingGpuWalkerThenAddTwoPcForLastWalker) { @@ -422,8 +423,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, TimestampPacketTests, givenTimestampPacketWhenDispat HardwareInterface::dispatchWalker( *mockCmdQ, multiDispatchInfo, - 0, - nullptr, + CsrDependencies(), nullptr, nullptr, nullptr, @@ -467,8 +467,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, TimestampPacketTests, givenTimestampPacketDisabledWh HardwareInterface::dispatchWalker( *mockCmdQ, multiDispatchInfo, - 0, - nullptr, + CsrDependencies(), nullptr, nullptr, nullptr, @@ -562,10 +561,10 @@ HWTEST_F(TimestampPacketTests, givenEventsRequestWhenEstimatingStreamSizeForCsrT auto cmdQ2 = std::make_unique>(&context2, device2.get(), nullptr); MockTimestampPacketContainer timestamp1(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 1); - MockTimestampPacketContainer timestamp2(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 1); - MockTimestampPacketContainer timestamp3(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 1); - MockTimestampPacketContainer timestamp4(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 1); - MockTimestampPacketContainer timestamp5(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 1); + MockTimestampPacketContainer timestamp2(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 2); + MockTimestampPacketContainer timestamp3(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 3); + MockTimestampPacketContainer timestamp4(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 4); + MockTimestampPacketContainer timestamp5(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 5); auto &csr = device->getUltCommandStreamReceiver(); auto &csr2 = device2->getUltCommandStreamReceiver(); @@ -593,7 +592,7 @@ HWTEST_F(TimestampPacketTests, givenEventsRequestWhenEstimatingStreamSizeForCsrT flags.csrDependencies.fillFromEventsRequestAndMakeResident(eventsRequest, csr, OCLRT::CsrDependencies::DependenciesType::OutOfCsr); auto sizeWithEvents = csr.getRequiredCmdStreamSize(flags, *device); - size_t extendedSize = sizeWithoutEvents + (numEventsOnWaitlist * (sizeof(typename FamilyType::MI_SEMAPHORE_WAIT) + sizeof(typename FamilyType::MI_ATOMIC))); + size_t extendedSize = sizeWithoutEvents + ((1 + 2 + 3 + 4 + 5) * (sizeof(typename FamilyType::MI_SEMAPHORE_WAIT) + sizeof(typename FamilyType::MI_ATOMIC))); EXPECT_EQ(sizeWithEvents, extendedSize); } @@ -604,10 +603,10 @@ HWTEST_F(TimestampPacketTests, givenEventsRequestWhenEstimatingStreamSizeForDiff auto cmdQ2 = std::make_unique>(context, device.get(), props); MockTimestampPacketContainer timestamp1(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 1); - MockTimestampPacketContainer timestamp2(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 1); - MockTimestampPacketContainer timestamp3(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 1); - MockTimestampPacketContainer timestamp4(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 1); - MockTimestampPacketContainer timestamp5(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 1); + MockTimestampPacketContainer timestamp2(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 2); + MockTimestampPacketContainer timestamp3(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 3); + MockTimestampPacketContainer timestamp4(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 4); + MockTimestampPacketContainer timestamp5(*device->getCommandStreamReceiver().getTimestampPacketAllocator(), 5); auto &csr = device->getUltCommandStreamReceiver(); auto &csr2 = cmdQ2->getUltCommandStreamReceiver(); @@ -635,7 +634,7 @@ HWTEST_F(TimestampPacketTests, givenEventsRequestWhenEstimatingStreamSizeForDiff flags.csrDependencies.fillFromEventsRequestAndMakeResident(eventsRequest, csr, OCLRT::CsrDependencies::DependenciesType::OutOfCsr); auto sizeWithEvents = csr.getRequiredCmdStreamSize(flags, *device.get()); - size_t extendedSize = sizeWithoutEvents + (numEventsOnWaitlist * (sizeof(typename FamilyType::MI_SEMAPHORE_WAIT) + sizeof(typename FamilyType::MI_ATOMIC))); + size_t extendedSize = sizeWithoutEvents + ((1 + 2 + 3 + 4 + 5) * (sizeof(typename FamilyType::MI_SEMAPHORE_WAIT) + sizeof(typename FamilyType::MI_ATOMIC))); EXPECT_EQ(sizeWithEvents, extendedSize); } @@ -876,11 +875,14 @@ HWTEST_F(TimestampPacketTests, givenTimestampPacketWriteEnabledWhenDispatchingTh cl_event waitlist[] = {&event1, &event2, &event3, &event4, &event5, &event6}; + EventsRequest eventsRequest(eventsOnWaitlist, waitlist, nullptr); + CsrDependencies csrDeps; + csrDeps.fillFromEventsRequestAndMakeResident(eventsRequest, mockCmdQ->getCommandStreamReceiver(), CsrDependencies::DependenciesType::OnCsr); + HardwareInterface::dispatchWalker( *mockCmdQ, multiDispatchInfo, - eventsOnWaitlist, - waitlist, + csrDeps, nullptr, nullptr, nullptr, @@ -956,11 +958,14 @@ HWTEST_F(TimestampPacketTests, givenTimestampPacketWriteEnabledOnDifferentCSRsFr cl_event waitlist[] = {&event1, &event2, &event3, &event4, &event5, &event6}; + EventsRequest eventsRequest(eventsOnWaitlist, waitlist, nullptr); + CsrDependencies csrDeps; + csrDeps.fillFromEventsRequestAndMakeResident(eventsRequest, mockCmdQ->getCommandStreamReceiver(), CsrDependencies::DependenciesType::OnCsr); + HardwareInterface::dispatchWalker( *mockCmdQ, multiDispatchInfo, - eventsOnWaitlist, - waitlist, + csrDeps, nullptr, nullptr, nullptr, diff --git a/unit_tests/profiling/profiling_tests.cpp b/unit_tests/profiling/profiling_tests.cpp index ec2f1a24cb..0436afa016 100644 --- a/unit_tests/profiling/profiling_tests.cpp +++ b/unit_tests/profiling/profiling_tests.cpp @@ -130,7 +130,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ProfilingTests, GIVENCommandQueueWithProfilingAndFor multiDispatchInfo.push(dispatchInfo); multiDispatchInfo.push(dispatchInfo); auto &commandStreamTask = getCommandStream(*pCmdQ, true, false, &kernel); - auto expectedSizeCS = EnqueueOperation::getTotalSizeRequiredCS(CL_COMMAND_TASK, 0, true, false, *pCmdQ, multiDispatchInfo); + auto expectedSizeCS = EnqueueOperation::getTotalSizeRequiredCS(CL_COMMAND_TASK, CsrDependencies(), true, false, *pCmdQ, multiDispatchInfo); EXPECT_GE(expectedSizeCS, requiredSize); EXPECT_GE(commandStreamTask.getAvailableSpace(), requiredSize); } @@ -604,7 +604,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ProfilingWithPerfCountersTests, GIVENCommandQueueWit multiDispatchInfo.push(dispatchInfo); multiDispatchInfo.push(dispatchInfo); auto &commandStreamTask = getCommandStream(*pCmdQ, true, true, &kernel); - auto expectedSizeCS = EnqueueOperation::getTotalSizeRequiredCS(CL_COMMAND_TASK, 0, true, true, *pCmdQ, multiDispatchInfo); + auto expectedSizeCS = EnqueueOperation::getTotalSizeRequiredCS(CL_COMMAND_TASK, CsrDependencies(), true, true, *pCmdQ, multiDispatchInfo); EXPECT_GE(expectedSizeCS, requiredSize); EXPECT_GE(commandStreamTask.getAvailableSpace(), requiredSize);