HP JFS 3.3 and HP OnLineJFS 3.3 VERITAS File System 3.3 System Administrator's Guide

Chapter 6 111
Application Interface
Cache Advisories
Cache Advisories
The VxFS file system allows an application to set cache advisories for use
when accessing files. These advisories are in memory only and they do
not persist across reboots.Some advisories are currently maintained on a
per-file, not a per-file-descriptor, basis. This means that only one set of
advisories can be in effect for all accesses to the file. If two conflicting
applications set different advisories, both use the last advisories that
were set.
All advisories are set using the VX_SETCACHE ioctl. The current set of
advisories can be obtained with the VX_GETCACHE ioctl. For details on the
use of these ioctls, see vxfsio(7).
NOTE The VX_SETCACHE ioctl is available only with the HP OnLineJFS product.
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 andwrites. 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 buffer cache that might be
better used for something else. The direct I/O feature can provide
significant performance gains for some applications.
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 file offset must be aligned on a 4-byte
boundary.
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 currently
being accessed by using memory mapped I/O, any direct I/O accesses are
done as data synchronous I/O.
Since 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