Direct I/O vs. normal cached I/O

Normally, the JFS or JFS2 caches file pages in kernel memory. When the application does a file read request, if the file page is not in memory, the JFS or JFS2 reads the data from the disk into the file cache, then copies the data from the file cache to the user's buffer..

For application writes, the data is merely copied from the user's buffer into the cache. The actual writes to disk are done later.

This type of caching policy can be extremely effective when the cache hit rate is high. It also enables read-ahead and write-behind policies. Lastly, it makes file writes asynchronous, allowing the application to continue processing instead of waiting for I/O requests to complete.

Direct I/O is an alternative caching policy that causes the file data to be transferred directly between the disk and the user's buffer. Direct I/O for files is functionally equivalent to raw I/O for devices. Applications can use direct I/O on JFS or JFS2 files.