Re: O_DIRECT support for Windows

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


Magnus Hagander <magnus(at)hagander(dot)net> wrote:

> 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.

Do you mean there are drives that have larger sector size than 8kB?
We've already put the xlog buffer along the alignment of
ALIGNOF_XLOG_BUFFER (typically 8192 bytes).
But if there are such drives, using FILE_FLAG_NO_BUFFERING is harmful!

> (btw, we already map O_DSYNC to FILE_FLAG_WRITE_THROUGH)

Yes, it is not consistent to the source code...
And if we had the conclusion you said, the comment should be
"We are not willing to use FILE_FLAG_NO_BUFFERING".

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nikolay Samokhvalov 2007-01-15 11:42:49 Re: xml type and encodings
Previous Message Magnus Hagander 2007-01-15 09:16:30 Re: O_DIRECT support for Windows

Browse pgsql-patches by date

  From Date Subject
Next Message CN 2007-01-15 12:01:56 Re: BCC55 and libpq 8.2
Previous Message Magnus Hagander 2007-01-15 09:16:30 Re: O_DIRECT support for Windows