Reputation: 3
For example, File system block size is 4k, but I only write 1 byte to the file using Direct IO, will kernel read this block to page cache before writing?
Upvotes: 0
Views: 133
Reputation: 1
Maybe. Direct IO on Linux is highly variable, and depends on the underlying filesystem.
A 1-byte direct IO write to a file system with a 4k block size may fail entirely, may fall back on using the page cache, or it may go via direct IO right to the file.
And unless it fails, you won't be able to tell very easily.
Upvotes: 0