Re: O_DIRECT support for Windows

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: O_DIRECT support for Windows
Date: 2007-01-15 09:16:30
Message-ID: 20070115091630.GA27530@svr2.hagander.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Mon, Jan 15, 2007 at 05:36:09PM +0900, ITAGAKI Takahiro wrote:
> The attached is a patch to define O_DIRECT by ourselves on Windows,
> and to map O_DIRECT to FILE_FLAG_NO_BUFFERING.
>
> There will be a consistency in our support between Windows and other OSes
> that have O_DIRECT. Also, there is the following comment that says, I read,
> we should do so.
> | handle other flags? (eg FILE_FLAG_NO_BUFFERING/FILE_FLAG_WRITE_THROUGH)
>
> Is this worth doing? Do we need more performance reports for the change?

IIRC we've discussed this before at some point, and I think we came to
the conclusion that we shouldn't do it. However, things may have
changed :-)

FILE_FLAG_NO_BUFFERING requires that *all* I/O follows:
* File access must begin at offsets that are integer multples of the
volume sector size.
* File access must be for number of bytes that are integer multiples of
the volume sector size.
* Buffer addresses for read and write operations must be sector aligned.

I was under the impression that our code can in no way guarantee this.
Especially given that a typical NTFS drive can have anything from 512 to
4096 bytes if you use the GUI to format it, and larger sizes than that
when you use some SAN tools to do it.

(btw, we already map O_DSYNC to FILE_FLAG_WRITE_THROUGH)

//Magnus

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message ITAGAKI Takahiro 2007-01-15 09:53:49 Re: O_DIRECT support for Windows
Previous Message ITAGAKI Takahiro 2007-01-15 08:36:09 O_DIRECT support for Windows

Browse pgsql-patches by date

  From Date Subject
Next Message ITAGAKI Takahiro 2007-01-15 09:53:49 Re: O_DIRECT support for Windows
Previous Message Dave Page 2007-01-15 09:14:56 Re: Allow dumping of roles or tablespaces