Skip to main content

 none
About the performance order of startio routine of WDM! Thanks! RRS feed

  • Question

  • The left figure is my application debug information,the right figure is kernel debug information of my WDM driver. In my driver, I insert the write Irp to STARTIO queue,and my application create three thread to WriteFile() the driver file. But as the result, only one thread performance correctly, other thread was canceled before when it was insert to STARTIO queue. so,why just only one thread can be performance, and other thread be canceled? thank!!!

    Tuesday, November 12, 2019 8:31 AM

Answers

  • STARTIO won't cancel the requests.  What does your Write handler actually do?  Are you passing the request to hardware below you, or are you completing them immediately?  Did you use FILE_FLAG_OVERLAPPED?  Are your threads waiting for completion, or terminating immediately after submitting the request?  All I/O requests are canceled when an application exits.

    Skip WDM and go straight to KMDF.  Really.  STARTIO has not been useful in a very, very, very long time.  There are much better ways to serialize access to your DMA engine using KMDF's I/O queues.


    Tim Roberts | Driver MVP Emeritus | Providenza & Boekelheide, Inc.

    • Marked as answer by Altman_Scxr Wednesday, November 13, 2019 1:10 PM
    Wednesday, November 13, 2019 7:59 AM

All replies

  • You might want to show us some code to go with this, StartIo is designed to handle one IRP at a time in a highly synchronous manner.  Until the first IRP is completed, another IRP will not be started.

    In general StartIo is the most inefficient approach to handling IRP's out there, most people were recommending against StartIo for more than 25 years.   An even bigger question is why are you developing a WDM driver, consider throwing out what you have and developing a KMDF driver, which is the standard for the last 15 years.

     


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Tuesday, November 12, 2019 12:29 PM
  • Thank you for reply, I mean that during the first Irp be deal, why other same Irp not be insert the startio queue, but be canceled? I write a WDM driver for a PCIe board, I want to use STARTIO approach for DMA operation, insure the DMA operation serial implement. The core or foundation of WDF is WDM,is right? So in start i learn the WDM and hope to get deeper understanding. But i will try to use KMDF to redo this driver, Hope i can solve these problem.
    Wednesday, November 13, 2019 12:42 AM
  • STARTIO won't cancel the requests.  What does your Write handler actually do?  Are you passing the request to hardware below you, or are you completing them immediately?  Did you use FILE_FLAG_OVERLAPPED?  Are your threads waiting for completion, or terminating immediately after submitting the request?  All I/O requests are canceled when an application exits.

    Skip WDM and go straight to KMDF.  Really.  STARTIO has not been useful in a very, very, very long time.  There are much better ways to serialize access to your DMA engine using KMDF's I/O queues.


    Tim Roberts | Driver MVP Emeritus | Providenza & Boekelheide, Inc.

    • Marked as answer by Altman_Scxr Wednesday, November 13, 2019 1:10 PM
    Wednesday, November 13, 2019 7:59 AM
  • Thank u very much. I found the reason is that I not wait the WriteFile Event in each thread and each thread directly terminated and return except the first thread,so the thread terminated cause the Irp be canceled.really thank u. I will start to port the driver to KMDF. 
    Wednesday, November 13, 2019 1:20 PM