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: Direct IO In RH 3.0

Re: Direct IO In RH 3.0

From: Mladen Gogala <mgogala_at_adelphia.net>
Date: Thu, 04 Mar 2004 06:36:10 -0500
Message-Id: <pan.2004.03.04.04.43.45.457195@adelphia.net>


On Wed, 03 Mar 2004 23:24:40 +0100, Rick Denoire wrote:

> Could you provide some references to the support of direct I/O in ext2
> and ext3? If ext2 really supports direct I/O flawlessly, then it is
> worth trying - what would be the trade offs here? (Since ext3 is
> supposed to be more advanced - but the journaling option is not needed
> for DB operations, the number + name + properties of the DB files does
> not change often)

Personal testing on the 2.4.25 kernel, using the following little program:

#include <sys/types.h>
#include <sys/stat.h>
#include <asm/fcntl.h>
#include <errno.h>
#include <string.h>
#define BUFFSIZE 65536
#define ALIGN    4096

main() {
char *buff;
int stat1=0,stat2=0,stat3=0;
int fd1=0,fd2=0;

   if (stat3=posix_memalign(&buff,ALIGN,BUFFSIZE)) {

      fprintf(stderr,"ALIGN ERR:%s\n",strerror(stat3));
      exit(0);

   }

   fd1=open("xxx", O_RDONLY|O_DIRECT,S_IRWXU);

   fd2=open("yyy",O_CREAT|O_WRONLY|O_DIRECT,S_IRWXU);    while(stat1=read(fd1,buff,BUFFSIZE)) {

         if (errno) {
            fprintf(stderr,"READ ERR:%s\n",strerror(errno));
            exit(0);
         }
         stat2=write(fd2,buff,(unsigned) stat1);
         if (errno) {
            fprintf(stderr,"WRITE ERR:%s\n",strerror(errno));
            exit(0);
         }

   }
   close(fd1);
   close(fd2);
}

The program returns EINVAL ("invalid argument") on 2.4.25 kernel on both ext3 and XFS. It works on ext2 and JFS. I have an empty disk partition and I've been playing around with mkfs.

-- 
Some people are only alive because it is illegal to shoot them.
Received on Thu Mar 04 2004 - 05:36:10 CST

Original text of this message

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