Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: directio and async io on redhat linux 3 and oracle 9i

Re: directio and async io on redhat linux 3 and oracle 9i

From: <yong321_at_yahoo.com>
Date: 8 May 2005 20:54:24 -0700
Message-ID: <1115610864.902041.265590@z14g2000cwz.googlegroups.com>


chao_ping wrote:
> By the way, does any one know how to verify the directio on solaris ufs
> via filesystemio_options?

I'm not sure about the answer but let me try. Direct I/O can be enabled in two ways, using forcedirectio mount option (you can find it with mount command after that), and using directio(3C) function call. Since Oracle's filesystemtio_options obviously can't control the mount, it must be making a directio() call. Note that this is a function, not syscall. By default, truss command won't show it. A simple program like this:

$ cat dio.c
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/fcntl.h>

main()
{
int fd, rc;
fd = open("testfile", O_RDONLY);
rc = directio(fd, DIRECTIO_ON);
printf("%d", rc);
}

shows `truss a.out` output as:
...

open("testfile", O_RDONLY)                      = 3
ioctl(3, _ION('f', 76, 0), 0x00000001)          = 0
...

I compiled dio.c with gcc. My testfile is on UFS (x86 Solaris 10). We need to find what the request _ION is. Anyway, if you truss an Oracle server process when you
alter system set filesystemio_options = directio; inside Oracle, watch for ioctl() with _ION as its second argument. (I don't know if it's _ION on other versions of Solaris. If not, adjust accordingly.)

Alternatively, try `truss -u:directio a.out`. In the test of my dio program, I see

/1:     open("testfile", O_RDONLY)                      = 3
/1_at_1:   -> libc:directio(0x3, 0x1, 0xd2ff260c, 0xd2f008e9)
/1:     ioctl(3, _ION('f', 76, 0), 0x00000001)          = 0
/1_at_1: <- libc:directio() = 0
Or try `truss -t!all -u:directio a.out` to remove all syscalls in output.

Let us know what you find out. I wish I had access to Oracle on Solaris at this time.

Yong Huang
yong321ATyahoo.com Received on Sun May 08 2005 - 22:54:24 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US