Re: O_DIRECT in freebsd

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Doug McNaught <doug(at)mcnaught(dot)org>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: O_DIRECT in freebsd
Date: 2003-10-29 15:06:34
Message-ID: 3964.1067439994@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Doug McNaught <doug(at)mcnaught(dot)org> writes:
> Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au> writes:
>> A new DIRECTIO kernel option enables support for read operations that
>> bypass the buffer cache and put data directly into a userland
>> buffer. This feature requires that the O_DIRECT flag is set on the
>> file descriptor and that both the offset and length for the read
>> operation are multiples of the physical media sector size.

> Linux and Solaris have had this for a while. I'm pretty sure it's
> been discussed before--search the archives. I think the consensus
> was that it might be useful for WAL writes, but would be a fair amount
> of work and would introduce portability issues...

Not for WAL --- we never read the WAL at all in normal operation. (If
it works for writes, then we would want to use it for writing WAL, but
that's not apparent from what Christopher quoted.)

IIRC there was speculation that this would be useful for large seqscans
and for vacuuming. It'd take some hacking to propagate the knowledge of
that context down to where the fopen occurs, though.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Manfred Spraul 2003-10-29 17:45:24 Re: O_DIRECT in freebsd
Previous Message Doug McNaught 2003-10-29 14:57:54 Re: O_DIRECT in freebsd