| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: sun solaris and direct io
On Fri, 03 Jun 2005 14:53:44 -0700, bchorng wrote:
> I am not an expert on IO calls, but I think all open( ) uses O_DSYNC( )
> flag.
> It is the subsequent calls that may vary depending if you use file
> system
> or not.
And what exactly is that you base your opinion on? Did you read Slowaris man page for the open(2) system call? did you look for directio function? Here is what I've been able to find out in a mysterious way that included knowledge of the dark side of the force:
Standard C Library Functions directio(3C)
NAME
directio - provide advice to file system
SYNOPSIS
#include <sys/types.h>
#include <sys/fcntl.h>
int directio(int fildes, int advice);
DESCRIPTION
The directio() function provides advice to the system about
the expected behavior of the application when accessing the
data in the file associated with the open file descriptor
fildes. The system uses this information to help optimize
accesses to the file's data. The directio() function has no
effect on the semantics of the other operations on the data,
NAME
mount_ufs - mount ufs file systems
SYNOPSIS
mount -F ufs [generic_options] [-o specific_options] [-O]
special | mount_point
mount -F ufs [generic_options] [-o specific_options] [-O]
special mount_point
DESCRIPTION
The mount utility attaches a ufs file system to the file
system hierarchy at the mount_point, which is the pathname
of a directory. If mount_point has any contents prior to the
mount operation, these are hidden until the file system is
unmounted.
If mount is invoked with special or mount_point as the only
arguments, mount will search /etc/vfstab to fill in the
missing arguments, including the specific_options. See
mount(1M).
If special and mount_point are specified without any
specific_options, the default is rw.
If the directory on which a file system is to be mounted is
a symbolic link, the file system is mounted on the directory
to which the symbolic link refers, rather than on top of the
symbolic link itself.
OPTIONS
See mount(1M) for the list of supported generic_options.
The following options are supported:
-o specific_options
Specify ufs file system specific options in a
comma-separated list with no intervening spaces.
If invalid options are specified, a warning mes-
sage is printed and the invalid options are
ignored. The following options are available:
dfratime | nodfratime
By default, writing access time updates to
the disk may be deferred (dfratime) for the
file system until the disk is accessed for
a reason other than updating access times.
nodfratime disables this behavior.
If power management is enabled on the sys-
tem, do not set nodfratime unless noatime
is also set. If you set nodfratime without
SunOS 5.9 Last change: 23 Jul 2003 1
System Administration Commands mount_ufs(1M)
setting noatime, the disk is spun up every
time a file within a file system on the
disk is accessed - even if the file is not
modified.
forcedirectio | noforcedirectio
If forcedirectio is specified and supported
by the file system, then for the duration
of the mount, forced direct I/O will be
used. If the filesystem is mounted using
forcedirectio, data is transferred directly
between user address space and the disk. If
the filesystem is mounted using nofor-
cedirectio, data is buffered in kernel
address space when data is transferred
between user address space and the disk.
forcedirectio is a performance option that
is of benefit only in large sequential data
transfers. The default behavior is nofor-
cedirectio.
System Administration Commands mount_ufs(1M)
bash-2.05$ uname -a
SunOS eora6.allegientsystems.com 5.9 Generic_112233-12 sun4u sparc SUNW,Sun-Fire-V240
BTW, if you are not using file system, you are using raw devices and raw devices are by default not buffered, which means that every I/O against a raw device is a direct I/O. RTFM is a recommended practice and if it wasn't for Johnatan's FAQ, I'd have recommended it to you.
-- I either want less corruption, or more chance to participate in it.Received on Mon Jun 06 2005 - 18:27:07 CDT
![]() |
![]() |