Common Misconfigured HP-UX Resources (April 2006)

may require four I/O requests. However, if the buffer cache is bypassed, a single 256 KB
direct I/O could potentially be performed.
Data accessed once
Management of the buffer cache requires additional code and processing. For data that is
accessed only once, the buffer cache does not provide any benefit for keeping the data in the
cache. In fact, by caching data that is accessed only once, the system may need to remove
buffer pages that are more frequently accessed.
System crash
Since many writes are delayed, the system may have many dirty buffers in the buffer cache
that need to be posted to disk when the system crashes. Data in the buffer cache that is not
flushed before the system comes down is lost.
Bypassing the Buffer Cache
There are several ways that I/O can avoid using the buffer cache altogether. Bypassing the buffer
cache is known as direct I/O.
For the following JFS features, the HP Online JFS license is needed to perform direct I/O:
mincache=direct, convosync=direct
For JFS file systems, if the file system is mounted with the mincache=direct option, the
convosync=direct option, or both, then reads and writes bypass the buffer cache and go
directly to the user-supplied buffer. If a file system is mounted with these options, all I/O to the
file system bypasses the buffer cache. Read ahead and write behind are not available since
there is no intermediate holding area. Refer to the mount_vxfs(1M) manpage for more
information.
ioctl (fd,VX_SETCACHE, VX_DIRECT)
For JFS file systems, this ioctl call will set the access for the file referenced by fd as direct
and will bypass the buffer cache. This call applies only to the instance of the file represented
by fd. Other applications opening the same file are not affected. Refer to the vxfsio(7)
manpage for more information.
Discovered direct I/O
JFS provides a feature called discovered direct IO, where I/O requests larger than a certain
size are done using direct I/O. Large I/O requests are typically performed by applications
that read data once, such as backup or copy operations. Since the data is accessed once,
there is no benefit to caching the data. Caching the data may even be detrimental as more
useful buffers may get flushed out to make room for this once-accessed data. Therefore, large
I/O requests on JFS file systems are performed directly and bypass the buffer cache. For JFS
3.1, the discovered direct I/O size is fixed at 128 Kb. For JFS 3.3 and later, the default
discovered direct I/O size is 256 Kb, but can set with vxtunefs command by setting the
discovered_direct_iosz tunable.
Raw I/O
If access to the data is through the raw device file, then the buffer cache is not used.
Async I/O
14