Veritas™ File System 5.0.1 Programmer's Reference Guide

applications use the last advisory that was set on the file. VxFS does not coordinate
or prioritize advisories.
Some advisories are not cleared from memory after the last close of the file.
Recorded advisories remain in memory for as long as the file system metadata
used to manage access to the file remains in memory. Removing file system
metadata for the file from memory is not predictable.
All advisories are set using the file descriptor, returned by the open() and ioctl()
calls using the VX_SETCACHE ioctl command.
See the vxfsio(7) manual page.
The caching advisories are described in the following sections.
Direct I/O
Direct I/O is an unbuffered form of I/O for accessing files. If the VX_DIRECT advisory
is set, the user requests 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 that is associated with I/O by eliminating the data copy between
the kernel buffer and the users buffer. Direct I/O also avoids taking up space in
the buffer cache that might be better used for something else, such as an
application cache. The direct I/O feature can provide significant performance
gains for some applications.
If a request fails to meet the alignment constraints for direct I/O, the request is
performed as data synchronous I/O. If the file is accessed by using memory mapped
I/O, any direct I/O accesses are done as data synchronous I/O.
Because direct I/O maintains the same data integrity as synchronous I/O, it can
be used in many applications that currently use synchronous I/O. If a direct I/O
request does not allocate storage or extend the file, the inode metadata is not
immediately written.
The CPU cost of direct I/O is about the same as a raw disk transfer. For sequential
I/O to very large files, using direct I/O with large transfer sizes can provide the
same speed as buffered I/O with much less CPU overhead.
If the file is extended or storage is allocated, direct I/O must write the inode change
before returning to the application. This write eliminates some of the performance
advantages of direct I/O.
The direct I/O advisory is maintained on a per-file-descriptor basis.
Veritas File System I/O
Caching advisories
74