Veritas File System 5.1 SP1 Administrator"s Guide (5900-1499, April 2011)

Buffered and Direct I/O
VxFS responds with read-ahead for sequential read I/O. This results in buffered
I/O. The data is prefetched and retained in buffers for the application. This is the
default VxFS behavior.
On the other hand, direct I/O does not buffer the data when the I/O to the
underlying device is completed. This saves system resources like memory and
CPU usage. Direct I/O is possible only when alignment and sizing criteria are
satisfied.
See Direct I/O requirements on page 70.
Each of the supported platforms has either a page cache or its own buffer cache.
These caches are commonly known as the file system caches.
Direct I/O does not use these caches. The memory used for direct I/O is discarded
after the I/O is complete,
Direct I/O
Direct I/O is an unbuffered form of I/O. If the VX_DIRECT advisory is set, the user
is requesting direct data transfer between the disk and the user-supplied buffer
for reads and writes. This bypasses the kernel buffering of data, and reduces the
CPU overhead associated with I/O by eliminating the data copy between the kernel
buffer and the user's buffer. This also avoids taking up space in the page cache
that might be better used for something else. The direct I/O feature can provide
significant performance gains for some applications.
The direct I/O and VX_DIRECT advisories are maintained on a per-file-descriptor
basis.
JFS (base VxFS) includes direct I/O without a license.
Direct I/O requirements
For an I/O operation to be performed as direct I/O, it must meet certain alignment
criteria. The alignment constraints are usually determined by the disk driver, the
disk controller, and the system memory management hardware and software.
The requirements for direct I/O are as follows:
The starting file offset must be aligned to a 1024-byte boundary.
The ending file offset must be aligned to a 1024-byte boundary, or the length
must be a multiple of 1024 bytes.
The memory buffer must start on an 4-byte boundary.
Veritas File System I/O
Buffered and Direct I/O
70