On Tue, 2003-08-19 at 00:21, Derek Martin wrote:
> On Mon, Aug 18, 2003 at 11:13:48PM -0400, Jeff Macdonald wrote:
> > Hi,
> > I am trying to understand how one uses raw disk i/o in Linux. I
> 
> If you're not a filesystem engineer, you probably just really don't
> want to do this.  This is the level at which the filesystem reads and
> writes data -- it is a raw byte stream.  If you write data at this
> level, you will destroy your filesystem. 
> 
> > understand that the i/o skips the kernel buffer. 
> 
> Well, IIRC, unlike most other Unix implementations, Linux disk I/O is
> /always/ block I/O (i.e. buffered by the kernel) unless you apply
> patches to the kernel.
> 
> However, if what you're trying to do is avoid a layer of buffers to
> increase performance, have a look at memory-mapped I/O.  See the man
> page for mmap(2), and/or a good book on programming on Unix systems.
> I'd suggest W. Richard Stevens' "Advanced Programming in the Unix
> Environment" for starters.
> 

I think that he's looking for the same raw i/o that oracle likes so
much:
http://www.tldp.org/HOWTO/SCSI-2.4-HOWTO/rawdev.html

But while you don't have to be writing a filesystem to want this, it's
still targeted for a pretty select audience.  Have you considered a
simple O_DIRECT instead?  As the parent post mentions, this may require
a patched kernel, depending on your vender and filesystem of choice. 
XFS has had it for a while, but isn't included in redhat kernels.  I
still recommend XFS for heavy I/O, as it was designed from the start to
be "industrial strength".  According to the following, redhat kernels
don't support O_DIRECT for ext3 either (yet)
https://listman.redhat.com/archives/ext3-users/2003-March/msg00114.html

aaron

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to