Hi All,
According to the Storport’s docs for virtual miniports - no spinlocks are гіув during a call to StartIo.
But under high load with DiskSpd.exe I can see with performance analyzer that spinlocks are constantly used in storport.sys!RaidStartIoPacket. And this seems to be a bottle neck for the miniport’s throughput when multiple threads doing I/O simultaneously. The cores are 100% busy trying to acquire the spinlocks.
Is it normal behavior when Storport calls a virtual miniport’s StartIo?
The miniport sets adapter’s parameters as follows:
pPortInfo->MaximumTransferLength = 0x10000;
pPortInfo->NumberOfPhysicalBreaks = 0x11;
pPortInfo->AlignmentMask = FILE_LONG_ALIGNMENT;
pPortInfo->NumberOfBuses = 1;
pPortInfo->InitiatorBusId[ 0 ] = 0x3F;
pPortInfo->MaximumNumberOfTargets = 64;
pPortInfo->MaximumNumberOfLogicalUnits = 8;
pPortInfo->SynchronizationModel = StorSynchronizeFullDuplex;
pPortInfo->VirtualDevice = TRUE;
pPortInfo->ScatterGather = TRUE;
pPortInfo->CachesData = FALSE;
pPortInfo->NeedPhysicalAddresses = TRUE;
pPortInfo->Master = TRUE;
pPortInfo->MaxIOsPerLun = 2048;
pPortInfo->InitialLunQueueDepth = 2048;
pPortInfo->MaxNumberOfIO = pPortInfo->MaxIOsPerLun * pPortInfo->MaximumNumberOfTargets * pPortInfo->MaximumNumberOfLogicalUnits;
pPortInfo->Dma64BitAddresses = SCSI_DMA64_MINIPORT_FULL64BIT_NO_BOUNDARY_REQ_SUPPORTED;
StorPortSetAdapterBusType(pDeviceExtension, 0xA);
and HW_INITIALIZATION_DATA setting are:
InitData.MapBuffers = STOR_MAP_NON_READ_WRITE_BUFFERS;
InitData.TaggedQueuing = TRUE;
InitData.AutoRequestSense = TRUE;
InitData.MultipleRequestPerLu = TRUE;
InitData.NeedPhysicalAddresses = TRUE;
InitData.FeatureSupport |= STOR_FEATURE_VIRTUAL_MINIPORT
| STOR_FEATURE_DEVICE_NAME_NO_SUFFIX
| STOR_FEATURE_FULL_PNP_DEVICE_CAPABILITIES
| STOR_FEATURE_ADAPTER_NOT_REQUIRE_IO_PORT;
InitData.SrbTypeFlags = SRB_TYPE_FLAG_STORAGE_REQUEST_BLOCK | SRB_TYPE_FLAG_SCSI_REQUEST_BLOCK;
InitData.AddressTypeFlags = ADDRESS_TYPE_FLAG_BTL8;