Re: Should raw I/O be added to the kernel?

Stephen C. Tweedie (sct@redhat.com)
Thu, 21 Jan 1999 17:35:21 GMT


Hi,

On Mon, 21 Dec 1998 22:33:06 +0100 (MET), Gerard Roudier
<groudier@club-internet.fr> said:

> If you want performances, then you also want to queue several IOs to the
> device at a time, each time it is possible. Imagine now, that you got an
> IO error on some IO currently being processed by the device. ...

>> Exactly right. Without raw disk IO, you couldn't guarantee a database
>> to always be in a consistent state on the disk (i.e. it isn't very

> I reply you that even with raw disk IO, it is not that easy to _really_
> guarantee such a consistency without being _really_ aware of what may
> _really_ happen with _real_ IOs, and that _real_ IO system services
> are generally too poor to allow full control on what _really_ happens
> with IOs.

Yes you can. The way these applications work is to write all of the
data for a commit, and to wait for it to complete before finally writing
a commit record. That way, provided the OS does not acknowledge the
write before it actually reaches the disk, the application can guarantee
enough about the write ordering to be sure about data consistency. Raw
IO, O_SYNC and fsync() provide enough support for the application to get
this right, but fsync() does not provide guaranteed IO error
notification so is not sufficient in the presence of errors.

--Stephen

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/