none
Analyzing time spent during an IO operation ? RRS feed

  • Question

  • When an IO request passes through driver stack(IO manager to file sytem to volume driver to disk driver to bus driver to actual device or hardware) to the actual device or actually memory access, time is spent during all this operation.

    Now I have 2 questions:

    1. Where does the most time is spent during an IO operation or which part takes the most time during an IO operation ?

    2. How to trace where time stamp using timer(or something else you may know) during an IO operation ?

    Tuesday, March 25, 2014 10:07 AM

Answers

  • The vast majority of the time is spent waiting the disk to return the data. This takes many orders of magnitude (e.g. 1000x) more time than processing the request on the host. You can trace and measure this using Windows Performance Recorder and Windows Performance Analyzer (part of the Assessment and Deployment Kit; ADK). It is an amazing tool that lets you dig deep into the system and watch what happened. There are lots of videos and tutorials on how to use it.

     -Brian


    Azius Developer Training www.azius.com Windows device driver, internals, security, & forensics training and consulting. Blog at www.azius.com/blog

    Tuesday, March 25, 2014 10:21 AM
    Moderator

All replies

  • The vast majority of the time is spent waiting the disk to return the data. This takes many orders of magnitude (e.g. 1000x) more time than processing the request on the host. You can trace and measure this using Windows Performance Recorder and Windows Performance Analyzer (part of the Assessment and Deployment Kit; ADK). It is an amazing tool that lets you dig deep into the system and watch what happened. There are lots of videos and tutorials on how to use it.

     -Brian


    Azius Developer Training www.azius.com Windows device driver, internals, security, & forensics training and consulting. Blog at www.azius.com/blog

    Tuesday, March 25, 2014 10:21 AM
    Moderator
  • Thanks for the reply. I am writing a disk cache upper filter driver. what I do is whenever a request comes to my filter driver I divide the request into chunks of 4kb length and then based on whether the data is present on fast disk or cache(I check this by maintaining a mapping list in my filter driver), I passes the request down either to fast disk or slow disk and then read or write the data. Suppose a request for reading 100kb comes then I create 25 new request in my filter driver, each will read 4kb from disk. 

    My questions are :

    1. Does it slow down the system as I am reading or writing in chunks of 4kb rather then passing whole request or will it remain same and does not depend on this?

    2. Do I really need to know about where is the request taking the maximum time and depend on that should I write my filter driver or I can just modify the request in some way and I just cant do anything about the access time of data  ?

    Wednesday, March 26, 2014 5:51 PM
  • Yes, breaking up a request into 25 smaller requests will slow the system down quite a bit. I think you need a much more sophisticated way of handling your requests, because the mechanism you are currently using will be slow and resource-intensive. Another important question is why are you doing this? Do you really think you are going to outperform the file system cache? Virtual block caches have much better performance (at the expense of using more memory) than logical block caches.

     -Brian


    Azius Developer Training www.azius.com Windows device driver, internals, security, & forensics training and consulting. Blog at www.azius.com/blog

    Wednesday, March 26, 2014 7:24 PM
    Moderator
  • I am writing a disk cache driver like ReadyBoost in windows and flashcache in linux. I will be using SSD as a fast disk. Suppose if I do not break the request into multiple chunks of 4kb then it would be very difficult to maintain data on fast disk. Currently I can store a whole request of(suppose 100kb) into different location in fast disk in 4kb chunks. Any suggestions? 
    Monday, March 31, 2014 5:51 AM