Using Buffered I/O RRS feed

  • Question

  • One of the guideline to determine to choose buffered vs direct IO is how much data is being transferred. The spec ( reads:

    "Drivers that transfer large amounts of data at a time, in particular, drivers that do multipage transfers, should not attempt to use buffered I/O"

    How does Microsoft define "large amount"? How can we determine if a transfer is going to be multipage and what is the value of  a page size?

    Wednesday, November 12, 2014 11:41 PM


  • There aren't any specific numbers that I can give you. It is relative to the speed of the CPU, the frequency of the I/Os, which IRQL you're at while the copy is happening, and so on. The fundamental idea is to reduce the impact on the CPU. Copies will end up flushing the data cache of useful data, so doing frequent copies will adversely affect system performance. Basically, if there is DMA hardware, then use it (with direct I/O), and if there isn't DMA hardware, then you don't have any choice but to do programmed I/O (with buffered I/O). In some cases, where you're transferring many pages worth of data, you might pair programmed I/O with direct I/O, but that's rare.


    Azius Developer Training Windows device driver, internals, security, & forensics training and consulting. Blog at

    Thursday, November 13, 2014 12:18 AM